diff --git a/rules-tests/TypeDeclaration/Rector/ClassMethod/ReturnNeverTypeRector/Fixture/skip_setters_param_intersection_docblock_not_autoload.php.inc b/rules-tests/TypeDeclaration/Rector/ClassMethod/ReturnNeverTypeRector/Fixture/skip_setters_param_intersection_docblock_not_autoload.php.inc new file mode 100644 index 00000000000..f6bbf63c21b --- /dev/null +++ b/rules-tests/TypeDeclaration/Rector/ClassMethod/ReturnNeverTypeRector/Fixture/skip_setters_param_intersection_docblock_not_autoload.php.inc @@ -0,0 +1,14 @@ +prop = $value; + } +} diff --git a/rules/TypeDeclaration/Rector/ClassMethod/ReturnNeverTypeRector.php b/rules/TypeDeclaration/Rector/ClassMethod/ReturnNeverTypeRector.php index 1ed00dde191..0d5fc6f7c9a 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/ReturnNeverTypeRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/ReturnNeverTypeRector.php @@ -141,7 +141,7 @@ private function hasNeverFuncCall(ClassMethod | Closure | Function_ $functionLik continue; } - $stmtType = $this->getType($stmt); + $stmtType = $this->nodeTypeResolver->getNativeType($stmt); if ($stmtType instanceof NeverType) { $hasNeverType = true; }