Updated Rector to commit fb353591ab57e19735b8a167140ead35c9b76047

fb353591ab [PhpDoc] Add warning about missing PhpDocInfo name form tag value node (#6134)
This commit is contained in:
Tomas Votruba 2024-07-09 14:29:04 +00:00
parent 1edceb7a20
commit 9400a5be04
2 changed files with 7 additions and 4 deletions

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '0f1e8ae03e2b768166471e543a9816c8fdaea5a7';
public const PACKAGE_VERSION = 'fb353591ab57e19735b8a167140ead35c9b76047';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-07-09 19:44:41';
public const RELEASE_DATE = '2024-07-09 16:26:42';
/**
* @var int
*/

View File

@ -5,7 +5,9 @@ namespace Rector\BetterPhpDocParser\PhpDocInfo;
use PHPStan\PhpDocParser\Ast\ConstExpr\ConstFetchNode;
use PHPStan\PhpDocParser\Ast\Node;
use PHPStan\PhpDocParser\Ast\PhpDoc\ExtendsTagValueNode;
use PHPStan\PhpDocParser\Ast\PhpDoc\GenericTagValueNode;
use PHPStan\PhpDocParser\Ast\PhpDoc\ImplementsTagValueNode;
use PHPStan\PhpDocParser\Ast\PhpDoc\InvalidTagValueNode;
use PHPStan\PhpDocParser\Ast\PhpDoc\MethodTagValueNode;
use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode;
@ -29,6 +31,7 @@ use Rector\BetterPhpDocParser\PhpDocNodeFinder\PhpDocNodeByTypeFinder;
use Rector\BetterPhpDocParser\ValueObject\Parser\BetterTokenIterator;
use Rector\BetterPhpDocParser\ValueObject\PhpDocAttributeKey;
use Rector\BetterPhpDocParser\ValueObject\Type\ShortenedIdentifierTypeNode;
use Rector\Exception\ShouldNotHappenException;
use Rector\PhpDocParser\PhpDocParser\PhpDocNodeTraverser;
use Rector\StaticTypeMapper\StaticTypeMapper;
/**
@ -69,7 +72,7 @@ final class PhpDocInfo
/**
* @var array<class-string<PhpDocTagValueNode>, string>
*/
private const TAGS_TYPES_TO_NAMES = [ReturnTagValueNode::class => '@return', ParamTagValueNode::class => '@param', VarTagValueNode::class => '@var', MethodTagValueNode::class => '@method', PropertyTagValueNode::class => '@property'];
private const TAGS_TYPES_TO_NAMES = [ReturnTagValueNode::class => '@return', ParamTagValueNode::class => '@param', VarTagValueNode::class => '@var', MethodTagValueNode::class => '@method', PropertyTagValueNode::class => '@property', ExtendsTagValueNode::class => '@extends', ImplementsTagValueNode::class => '@implements'];
/**
* @var bool
*/
@ -293,7 +296,7 @@ final class PhpDocInfo
}
$name = $this->resolveNameForPhpDocTagValueNode($phpDocTagValueNode);
if (!\is_string($name)) {
return;
throw new ShouldNotHappenException(\sprintf('Name could not be resolved for "%s" tag value node. Complete it to %s::TAGS_TYPES_TO_NAMES constant', \get_class($phpDocTagValueNode), self::class));
}
$phpDocTagNode = new PhpDocTagNode($name, $phpDocTagValueNode);
$this->addPhpDocTagNode($phpDocTagNode);