Descriptions were not separated into tags

This commit is contained in:
Mike van Riel
2015-06-13 20:27:27 +02:00
committed by Mike van Riel
parent ab3ebf467c
commit 53d5adb324
3 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -100,8 +100,8 @@ class DescriptionFactory
$tagCount = 0; $tagCount = 0;
$tags = []; $tags = [];
for ($i = 1; $i < $count; $i += 2) { for ($i = 1; $i < $count; $i += 2) {
$tokens[$i] = '%' . ++$tagCount . '$s';
$tags[] = $this->tagFactory->create($tokens[$i], $context); $tags[] = $this->tagFactory->create($tokens[$i], $context);
$tokens[$i] = '%' . ++$tagCount . '$s';
} }
//In order to allow "literal" inline tags, the otherwise invalid //In order to allow "literal" inline tags, the otherwise invalid
+2 -1
View File
@@ -12,6 +12,7 @@
namespace phpDocumentor\Reflection\DocBlock; namespace phpDocumentor\Reflection\DocBlock;
use phpDocumentor\Reflection\DocBlock\Tags\Other;
use phpDocumentor\Reflection\FqsenResolver; use phpDocumentor\Reflection\FqsenResolver;
use phpDocumentor\Reflection\Types\Context; use phpDocumentor\Reflection\Types\Context;
@@ -84,7 +85,7 @@ final class TagFactory
} }
list($tagName, $tagBody) = $this->extractTagParts($tagLine); list($tagName, $tagBody) = $this->extractTagParts($tagLine);
$handler = Tag::class; $handler = Other::class;
if (isset($this->tagHandlerMappings[$tagName])) { if (isset($this->tagHandlerMappings[$tagName])) {
$handler = $this->tagHandlerMappings[$tagName]; $handler = $this->tagHandlerMappings[$tagName];
} elseif ($this->isAnnotation($tagName)) { } elseif ($this->isAnnotation($tagName)) {
+6 -1
View File
@@ -14,6 +14,7 @@ namespace phpDocumentor\Reflection;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use phpDocumentor\Reflection\DocBlock\TagFactory; use phpDocumentor\Reflection\DocBlock\TagFactory;
use phpDocumentor\Reflection\Types\Context;
final class DocBlockFactory implements DocBlockFactoryInterface final class DocBlockFactory implements DocBlockFactoryInterface
{ {
@@ -80,12 +81,16 @@ final class DocBlockFactory implements DocBlockFactoryInterface
$docblock = $docblock->getDocComment(); $docblock = $docblock->getDocComment();
} }
if ($context === null) {
$context = new Context('');
}
$parts = $this->splitDocBlock($this->stripDocComment($docblock)); $parts = $this->splitDocBlock($this->stripDocComment($docblock));
list($templateMarker, $summary, $description, $tags) = $parts; list($templateMarker, $summary, $description, $tags) = $parts;
return new DocBlock( return new DocBlock(
$summary, $summary,
new DocBlock\Description($description), $this->descriptionFactory->create($description, $context),
$this->parseTagBlock($tags), $this->parseTagBlock($tags),
$context, $context,
$location, $location,