mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
More cleanup of tag creation
TagWithType need to be created via a factory now.
This commit is contained in:
@@ -26,6 +26,7 @@ use phpDocumentor\Reflection\DocBlock\Tags\Return_;
|
||||
use phpDocumentor\Reflection\DocBlock\Tags\See;
|
||||
use phpDocumentor\Reflection\DocBlock\Tags\Since;
|
||||
use phpDocumentor\Reflection\DocBlock\Tags\Template;
|
||||
use phpDocumentor\Reflection\Exception\ParserException;
|
||||
use phpDocumentor\Reflection\PseudoTypes\ConstExpression;
|
||||
use phpDocumentor\Reflection\Types\Array_;
|
||||
use phpDocumentor\Reflection\Types\Compound;
|
||||
@@ -242,18 +243,26 @@ DOC;
|
||||
$factory = DocBlockFactory::createInstance();
|
||||
$docblock = $factory->create($docComment);
|
||||
|
||||
self::assertEquals(
|
||||
[
|
||||
InvalidTag::create(
|
||||
'array\Foo> $test',
|
||||
'param',
|
||||
)->withError(
|
||||
new \InvalidArgumentException(
|
||||
'Could not find type in array\Foo> $test, please check for malformed notations')
|
||||
),
|
||||
],
|
||||
$docblock->getTags()
|
||||
);
|
||||
$tags = $docblock->getTags();
|
||||
|
||||
self::assertCount(1, $docblock->getTags());
|
||||
self::assertInstanceOf(InvalidTag::class, $tags[0]);
|
||||
self::assertCount(1, $docblock->getTags());
|
||||
self::assertSame('Failed to parse docblock: Unexpected token ">", expected variable at offset 16 on line 1', $tags[0]->getException()->getMessage());
|
||||
|
||||
|
||||
// self::assertEquals(
|
||||
// [
|
||||
// InvalidTag::create(
|
||||
// 'array\Foo> $test',
|
||||
// 'param',
|
||||
// )->withError(
|
||||
// new ParserException(
|
||||
// 'Could not find type in array\Foo> $test, please check for malformed notations', 'aa', 1)
|
||||
// ),
|
||||
// ],
|
||||
// $docblock->getTags()
|
||||
// );
|
||||
}
|
||||
|
||||
public function testConstantReferenceTypes(): void
|
||||
|
||||
Reference in New Issue
Block a user