diff --git a/rules-tests/Php80/Rector/FunctionLike/UnionTypesRector/Fixture/_remove_doc_array_typed2.php.inc b/rules-tests/Php80/Rector/FunctionLike/UnionTypesRector/Fixture/_remove_doc_array_typed2.php.inc new file mode 100644 index 00000000000..e33ee0c00c4 --- /dev/null +++ b/rules-tests/Php80/Rector/FunctionLike/UnionTypesRector/Fixture/_remove_doc_array_typed2.php.inc @@ -0,0 +1,30 @@ + $value + */ + public function normalizeNodeValue($value) + { + return $value; + } +} + +?> +----- + diff --git a/rules/DeadCode/PhpDoc/DeadParamTagValueNodeAnalyzer.php b/rules/DeadCode/PhpDoc/DeadParamTagValueNodeAnalyzer.php index 63c772faeb8..31340b36eb9 100644 --- a/rules/DeadCode/PhpDoc/DeadParamTagValueNodeAnalyzer.php +++ b/rules/DeadCode/PhpDoc/DeadParamTagValueNodeAnalyzer.php @@ -8,6 +8,7 @@ use PhpParser\Node\Param; use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode; use PHPStan\PhpDocParser\Ast\Type\GenericTypeNode; +use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use Rector\BetterPhpDocParser\ValueObject\Type\BracketsAwareUnionTypeNode; use Rector\BetterPhpDocParser\ValueObject\Type\SpacingAwareCallableTypeNode; use Rector\NodeNameResolver\NodeNameResolver; @@ -61,6 +62,10 @@ private function hasGenericType(BracketsAwareUnionTypeNode $bracketsAwareUnionTy foreach ($types as $type) { if ($type instanceof GenericTypeNode) { + if ($type->type instanceof IdentifierTypeNode && $type->type->name === 'array') { + continue; + } + return true; } }