Skip to content

Commit cb12687

Browse files
committed
fix: skip non-native methods
1 parent 458f17a commit cb12687

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rules/CodingStyle/Guard/ArrowFunctionAndClosureFirstClassCallableGuard.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use PhpParser\Node\Param;
1919
use PhpParser\NodeVisitor;
2020
use PHPStan\Analyser\Scope;
21-
use PHPStan\Reflection\Annotations\AnnotationMethodReflection;
21+
use PHPStan\Reflection\MethodReflection;
2222
use Rector\NodeNameResolver\NodeNameResolver;
2323
use Rector\NodeTypeResolver\Node\AttributeKey;
2424
use Rector\PhpDocParser\NodeTraverser\SimpleCallableNodeTraverser;
@@ -95,8 +95,8 @@ public function shouldSkip(
9595
return true;
9696
}
9797

98-
// exists, but by @method annotation
99-
if ($reflection instanceof AnnotationMethodReflection && ! $reflection->getDeclaringClass()->hasNativeMethod(
98+
// phpstan reports first class callables that are not native methods
99+
if ($reflection instanceof MethodReflection && ! $reflection->getDeclaringClass()->hasNativeMethod(
100100
$reflection->getName()
101101
)) {
102102
return true;

0 commit comments

Comments
 (0)