From d3cbc396a9831a67ccf7af9aafd323b106595f00 Mon Sep 17 00:00:00 2001 From: Jaapio Date: Wed, 20 Mar 2024 22:06:02 +0100 Subject: [PATCH] Add extra deprecation --- src/DocBlock/Tags/Factory/ParamFactory.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/DocBlock/Tags/Factory/ParamFactory.php b/src/DocBlock/Tags/Factory/ParamFactory.php index 0e4c703..c44fe79 100644 --- a/src/DocBlock/Tags/Factory/ParamFactory.php +++ b/src/DocBlock/Tags/Factory/ParamFactory.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace phpDocumentor\Reflection\DocBlock\Tags\Factory; +use Doctrine\Deprecations\Deprecation; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\Tag; use phpDocumentor\Reflection\DocBlock\Tags\Param; @@ -16,6 +17,7 @@ use PHPStan\PhpDocParser\Ast\PhpDoc\TypelessParamTagValueNode; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use Webmozart\Assert\Assert; +use function sprintf; use function trim; /** @@ -37,6 +39,15 @@ final class ParamFactory implements PHPStanFactory $tagValue = $node->value; if ($tagValue instanceof InvalidTagValueNode) { + Deprecation::trigger( + 'phpdocumentor/reflection-docblock', + 'https://github.com/phpDocumentor/ReflectionDocBlock/issues/362', + sprintf( + 'Param tag value "%s" is invalid, falling back to legacy parsing. Please update your docblocks.', + $tagValue->value + ) + ); + return Param::create($tagValue->value, $this->typeResolver, $this->descriptionFactory, $context); }