getContent() public method

Gets the content of this tag.
public getContent ( ) : string
return string
コード例 #1
0
ファイル: TagTest.php プロジェクト: scrobot/Lumen
 /**
  * Test that the \phpDocumentor\Reflection\DocBlock\Tag\VarTag can
  * understand the @var doc block.
  *
  * @param string $type
  * @param string $content
  * @param string $exDescription
  *
  * @covers       \phpDocumentor\Reflection\DocBlock\Tag
  * @dataProvider provideDataForConstuctor
  *
  * @return void
  */
 public function testConstructorParesInputsIntoCorrectFields($type, $content, $exDescription)
 {
     $tag = new Tag($type, $content);
     $this->assertEquals($type, $tag->getName());
     $this->assertEquals($content, $tag->getContent());
     $this->assertEquals($exDescription, $tag->getDescription());
 }
コード例 #2
0
 /**
  * @param string       $type
  * @param DocBlock\Tag $tag
  * @return string|null
  */
 private function resolve($type, DocBlock\Tag $tag)
 {
     if (strpos($type, '\\') === 0) {
         $type = rtrim($type, '[]');
         $tagName = new Node\Name(trim($type, '\\'));
         if (strpos($tag->getContent(), $type) === false) {
             $tagName = $this->resolveClassName($tagName);
         }
         return $tagName->toString();
     }
     return null;
 }
コード例 #3
0
ファイル: TagReader.php プロジェクト: bvarent/doc-block-tags
 /**
  * Creates (or keeps) a Tag from a phpDocumentor Tag.
  *  If a custom Tag class was registered, it has priority.
  * @param Tag $tag
  * @return Tag
  */
 protected function createTagAnnotation(Tag $tag)
 {
     $name = $tag->getName();
     // If our own map of tags doesn't have a registered class, keep the original tag.
     if (isset($this->tagClassNameMap[$name])) {
         $tagClassName = $this->tagClassNameMap[$name];
         $annotationTag = new $tagClassName($tag->getName(), $tag->getContent(), $tag->getDocBlock(), $tag->getLocation());
     } else {
         $annotationTag = $tag;
     }
     return $annotationTag;
 }