/** * 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()); }
/** * @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; }
/** * 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; }