當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Reflection_Docblock_Tag類代碼示例

本文整理匯總了PHP中Zend_Reflection_Docblock_Tag的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Reflection_Docblock_Tag類的具體用法?PHP Zend_Reflection_Docblock_Tag怎麽用?PHP Zend_Reflection_Docblock_Tag使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Zend_Reflection_Docblock_Tag類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: fromReflection

 /**
  * fromReflection()
  *
  * @param Zend_Reflection_Docblock_Tag $reflectionTagReturn
  * @return Zend_CodeGenerator_Php_Docblock_Tag_License
  */
 public static function fromReflection(Zend_Reflection_Docblock_Tag $reflectionTagLicense)
 {
     $returnTag = new self();
     $returnTag->setName('license');
     $returnTag->setUrl($reflectionTagLicense->getUrl());
     $returnTag->setDescription($reflectionTagLicense->getDescription());
     return $returnTag;
 }
開發者ID:Yaoming9,項目名稱:Projet-Web-PhP,代碼行數:14,代碼來源:License.php

示例2: fromReflection

 /**
  * fromReflection()
  *
  * @param Zend_Reflection_Docblock_Tag $reflectionTagReturn
  * @return Zend_CodeGenerator_Php_Docblock_Tag_Return
  */
 public static function fromReflection(Zend_Reflection_Docblock_Tag $reflectionTagReturn)
 {
     $returnTag = new self();
     $returnTag->setName('return');
     $returnTag->setDatatype($reflectionTagReturn->getType());
     // @todo rename
     $returnTag->setDescription($reflectionTagReturn->getDescription());
     return $returnTag;
 }
開發者ID:ramonornela,項目名稱:Zebra,代碼行數:15,代碼來源:Return.php

示例3: fromReflection

 /**
  * fromReflection()
  *
  * @param Zend_Reflection_Docblock_Tag $reflectionTagParam
  * @return Zend_CodeGenerator_Php_Docblock_Tag
  */
 public static function fromReflection(Zend_Reflection_Docblock_Tag $reflectionTagParam)
 {
     $paramTag = new self();
     $paramTag->setName('param');
     $paramTag->setDatatype($reflectionTagParam->getType());
     // @todo rename
     $paramTag->setParamName($reflectionTagParam->getVariableName());
     $paramTag->setDescription($reflectionTagParam->getDescription());
     return $paramTag;
 }
開發者ID:sepano,項目名稱:open-social-media-monitoring,代碼行數:16,代碼來源:Param.php

示例4: fromReflection

 /**
  * fromReflection()
  *
  * @param Zend_Reflection_Docblock_Tag $reflectionTag
  * @return Zend_CodeGenerator_Php_Docblock_Tag
  */
 public static function fromReflection(Zend_Reflection_Docblock_Tag $reflectionTag)
 {
     $tagName = $reflectionTag->getName();
     $codeGenDocblockTag = self::factory($tagName);
     // transport any properties via accessors and mutators from reflection to codegen object
     $reflectionClass = new ReflectionClass($reflectionTag);
     foreach ($reflectionClass->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
         if (substr($method->getName(), 0, 3) == 'get') {
             $propertyName = substr($method->getName(), 3);
             if (method_exists($codeGenDocblockTag, 'set' . $propertyName)) {
                 $codeGenDocblockTag->{'set' . $propertyName}($reflectionTag->{'get' . $propertyName}());
             }
         }
     }
     return $codeGenDocblockTag;
 }
開發者ID:crodriguezn,項目名稱:crossfit-milagro,代碼行數:22,代碼來源:Tag.php

示例5: _parse

 protected function _parse()
 {
     $docComment = $this->_docComment;
     // First remove doc block line starters
     $docComment = preg_replace('#[ \\t]*(?:\\/\\*\\*|\\*\\/|\\*)?[ ]{0,1}(.*)?#', '$1', $docComment);
     $docComment = ltrim($docComment, "\r\n");
     // Next parse out the tags and descriptions
     $parsedDocComment = $docComment;
     $lineNumber = $firstBlandLineEncountered = 0;
     while (($newlinePos = strpos($parsedDocComment, "\n")) !== false) {
         $lineNumber++;
         $line = substr($parsedDocComment, 0, $newlinePos);
         if (strpos($line, '@') === 0 && preg_match('#^(@\\w+.*?)(\\n)(?:@|\\r?\\n|$)#s', $parsedDocComment, $matches)) {
             $this->_tags[] = Zend_Reflection_Docblock_Tag::factory($matches[1]);
             $parsedDocComment = str_replace($matches[1] . $matches[2], '', $parsedDocComment);
         } else {
             if ($lineNumber < 3 && !$firstBlandLineEncountered) {
                 $this->_shortDescription .= $line . "\n";
             } else {
                 $this->_longDescription .= $line . "\n";
             }
             if ($line == '') {
                 $firstBlandLineEncountered = true;
             }
             $parsedDocComment = substr($parsedDocComment, $newlinePos + 1);
         }
     }
     $this->_shortDescription = rtrim($this->_shortDescription);
     $this->_longDescription = rtrim($this->_longDescription);
 }
開發者ID:jorgenils,項目名稱:zend-framework,代碼行數:30,代碼來源:Docblock.php

示例6: getReturn

 /**
  * Get return type tag
  *
  * @return Zend_Reflection_Docblock_Tag_Return
  */
 public function getReturn()
 {
     $docblock = $this->getDocblock();
     if (!$docblock->hasTag('return')) {
         require_once PHP_LIBRARY_PATH . 'Zend/Reflection/Exception.php';
         throw new Zend_Reflection_Exception('Function does not specify an @return annotation tag; cannot determine return type');
     }
     $tag = $docblock->getTag('return');
     $return = Zend_Reflection_Docblock_Tag::factory('@return ' . $tag->getDescription());
     return $return;
 }
開發者ID:netixx,項目名稱:Stock,代碼行數:16,代碼來源:Function.php


注:本文中的Zend_Reflection_Docblock_Tag類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。