Skip to content

Commit d3cbc39

Browse files
committed
Add extra deprecation
1 parent fc9a233 commit d3cbc39

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/DocBlock/Tags/Factory/ParamFactory.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace phpDocumentor\Reflection\DocBlock\Tags\Factory;
66

7+
use Doctrine\Deprecations\Deprecation;
78
use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
89
use phpDocumentor\Reflection\DocBlock\Tag;
910
use phpDocumentor\Reflection\DocBlock\Tags\Param;
@@ -16,6 +17,7 @@
1617
use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
1718
use Webmozart\Assert\Assert;
1819

20+
use function sprintf;
1921
use function trim;
2022

2123
/**
@@ -37,6 +39,15 @@ public function create(PhpDocTagNode $node, Context $context): Tag
3739
$tagValue = $node->value;
3840

3941
if ($tagValue instanceof InvalidTagValueNode) {
42+
Deprecation::trigger(
43+
'phpdocumentor/reflection-docblock',
44+
'https://github.com/phpDocumentor/ReflectionDocBlock/issues/362',
45+
sprintf(
46+
'Param tag value "%s" is invalid, falling back to legacy parsing. Please update your docblocks.',
47+
$tagValue->value
48+
)
49+
);
50+
4051
return Param::create($tagValue->value, $this->typeResolver, $this->descriptionFactory, $context);
4152
}
4253

0 commit comments

Comments
 (0)