diff --git a/phpstan.neon b/phpstan.neon index 2adabacdfcf..37f72fc198a 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -83,8 +83,8 @@ parameters: - identifier: argument.type - - - identifier: phpstanApi.varTagAssumption +# - +# identifier: phpstanApi.varTagAssumption # is nested expr - diff --git a/rules/TypeDeclaration/TypeInferer/ReturnTypeInferer.php b/rules/TypeDeclaration/TypeInferer/ReturnTypeInferer.php index 1eb2882fb49..45d0c1f8d36 100644 --- a/rules/TypeDeclaration/TypeInferer/ReturnTypeInferer.php +++ b/rules/TypeDeclaration/TypeInferer/ReturnTypeInferer.php @@ -10,7 +10,6 @@ use PHPStan\Type\MixedType; use PHPStan\Type\Type; use Rector\TypeDeclaration\TypeInferer\ReturnTypeInferer\ReturnedNodesReturnTypeInfererTypeInferer; -use Rector\TypeDeclaration\TypeNormalizer; /** * @internal diff --git a/src/Autoloading/BootstrapFilesIncluder.php b/src/Autoloading/BootstrapFilesIncluder.php index 5fd2d28e2db..b63f4e7ff4d 100644 --- a/src/Autoloading/BootstrapFilesIncluder.php +++ b/src/Autoloading/BootstrapFilesIncluder.php @@ -41,7 +41,6 @@ public function includeBootstrapFiles(): void private function requireRectorStubs(): void { - /** @var false|string $stubsRectorDirectory */ $stubsRectorDirectory = realpath(__DIR__ . '/../../stubs-rector'); if ($stubsRectorDirectory === false) { return; diff --git a/src/BetterPhpDocParser/PhpDocInfo/PhpDocInfo.php b/src/BetterPhpDocParser/PhpDocInfo/PhpDocInfo.php index 0dcda4dee18..81742198827 100644 --- a/src/BetterPhpDocParser/PhpDocInfo/PhpDocInfo.php +++ b/src/BetterPhpDocParser/PhpDocInfo/PhpDocInfo.php @@ -529,7 +529,7 @@ public function findByAnnotationClass(string $desiredClass): array private function resolveNameForPhpDocTagValueNode(PhpDocTagValueNode $phpDocTagValueNode): ?string { foreach (self::TAGS_TYPES_TO_NAMES as $tagValueNodeType => $name) { - /** @var class-string $tagValueNodeType */ + /** @var class-string $tagValueNodeType */ if ($phpDocTagValueNode instanceof $tagValueNodeType) { return $name; } diff --git a/src/NodeTypeResolver/PhpDocNodeVisitor/ClassRenamePhpDocNodeVisitor.php b/src/NodeTypeResolver/PhpDocNodeVisitor/ClassRenamePhpDocNodeVisitor.php index 27aaefff6e1..4551416fd66 100644 --- a/src/NodeTypeResolver/PhpDocNodeVisitor/ClassRenamePhpDocNodeVisitor.php +++ b/src/NodeTypeResolver/PhpDocNodeVisitor/ClassRenamePhpDocNodeVisitor.php @@ -73,8 +73,11 @@ public function enterNode(Node $node): ?Node $objectType = $this->ensureFQCNObject($staticType, $node->name); foreach ($this->oldToNewTypes as $oldToNewType) { - /** @var ObjectType $oldType */ $oldType = $oldToNewType->getOldType(); + if (! $oldType instanceof ObjectType) { + continue; + } + if (! $objectType->equals($oldType)) { continue; }