diff --git a/rules/DeadCode/Rector/ClassMethod/RemoveUnusedPrivateMethodRector.php b/rules/DeadCode/Rector/ClassMethod/RemoveUnusedPrivateMethodRector.php index 9386adbd2de..cc06860fe65 100644 --- a/rules/DeadCode/Rector/ClassMethod/RemoveUnusedPrivateMethodRector.php +++ b/rules/DeadCode/Rector/ClassMethod/RemoveUnusedPrivateMethodRector.php @@ -11,6 +11,7 @@ use PhpParser\Node\Stmt\ClassMethod; use PHPStan\PhpDocParser\Ast\PhpDoc\GenericTagValueNode; use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode; use PHPStan\Reflection\ClassReflection; +use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo; use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory; use Rector\DeadCode\NodeAnalyzer\IsClassMethodUsedAnalyzer; use Rector\NodeTypeResolver\Node\AttributeKey; @@ -144,8 +145,8 @@ CODE_SAMPLE if (!$classMethod->isPublic()) { continue; } - $phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($classMethod); - if ($phpDocInfo->hasByName('dataProvider')) { + $phpDocInfo = $this->phpDocInfoFactory->createFromNode($classMethod); + if ($phpDocInfo instanceof PhpDocInfo && $phpDocInfo->hasByName('dataProvider')) { $dataProvider = $phpDocInfo->getByName('dataProvider'); if ($dataProvider instanceof PhpDocTagNode && $dataProvider->value instanceof GenericTagValueNode) { $dataProviderMethod = $class->getMethod($dataProvider->value->value); diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index a0db63478c6..91edc1396e4 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = '1d7208b816e8c12d7732a2d633b44d8e8bc0041e'; + public const PACKAGE_VERSION = '615913ddaf7b0df3a2c56d50cf6973408aa1a983'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-11-25 15:53:11'; + public const RELEASE_DATE = '2024-11-25 15:10:37'; /** * @var int */