mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 18:13:13 +00:00
Descriptions were not separated into tags
This commit is contained in:
committed by
Mike van Riel
parent
ab3ebf467c
commit
53d5adb324
@@ -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
|
||||||
|
|||||||
@@ -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)) {
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user