Skip to content

Commit

Permalink
Add extra deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
jaapio committed Mar 20, 2024
1 parent fc9a233 commit d3cbc39
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/DocBlock/Tags/Factory/ParamFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

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;
Expand All @@ -16,6 +17,7 @@
use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
use Webmozart\Assert\Assert;

use function sprintf;
use function trim;

/**
Expand All @@ -37,6 +39,15 @@ public function create(PhpDocTagNode $node, Context $context): Tag
$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);
}

Expand Down

0 comments on commit d3cbc39

Please sign in to comment.