diff --git a/rules/DowngradePhp82/Rector/FunctionLike/DowngradeStandaloneNullTrueFalseReturnTypeRector.php b/rules/DowngradePhp82/Rector/FunctionLike/DowngradeStandaloneNullTrueFalseReturnTypeRector.php index 3f22e29d..2263f99e 100644 --- a/rules/DowngradePhp82/Rector/FunctionLike/DowngradeStandaloneNullTrueFalseReturnTypeRector.php +++ b/rules/DowngradePhp82/Rector/FunctionLike/DowngradeStandaloneNullTrueFalseReturnTypeRector.php @@ -89,16 +89,8 @@ public function refactor(Node $node): ?Node return null; } - if (! $node instanceof ClassMethod) { - // in closure and arrow function can't add `@return null` docblock as they are Expr - // that rely on Stmt - $phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($node); - $this->phpDocTypeChanger->changeReturnType($node, $phpDocInfo, $this->resolveType($node->returnType)); - - $node->returnType = $this->resolveNativeType($node, $node->returnType); - return $node; - } - + // in closure and arrow function can't add `@return null` docblock as they are Expr + // that rely on Stmt $phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($node); $this->phpDocTypeChanger->changeReturnType($node, $phpDocInfo, $this->resolveType($node->returnType));