Fix issue when processing invalid tags

When invalid tags are processed a null was returned causing all kind
of issues in the normal behavior of this libary. As a solution a generic tag
could be created. But that would just drop the error information in.
Therefore a new tag was introduced, `invalidTag` the tag is just like the
generic tag but does contain the error triggered during the creation of the
tag. Which might help applications like phpdocumentor to display validation issues.
This commit is contained in:
Jaapio
2020-01-03 13:33:06 +01:00
parent 43f90ab91c
commit bdecc2d3bf
7 changed files with 106 additions and 48 deletions
+1 -4
View File
@@ -69,10 +69,7 @@ class DescriptionFactory
$tags = [];
for ($i = 1; $i < $count; $i += 2) {
$tag = $this->tagFactory->create($tokens[$i], $context);
if ($tag !== null) {
$tags[] = $tag;
}
$tags[] = $this->tagFactory->create($tokens[$i], $context);
$tokens[$i] = '%' . ++$tagCount . '$s';
}