File tree 1 file changed +11
-9
lines changed
1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -38,16 +38,18 @@ public function enterNode(Node $node)
38
38
$ functionName = $ node ->namespacedName ->toLowerString ();
39
39
foreach ($ node ->attrGroups as $ attrGroup ) {
40
40
foreach ($ attrGroup ->attrs as $ attr ) {
41
- if ($ attr ->name ->toString () === Pure::class) {
42
- // PhpStorm stub's #[Pure(true)] mean sthe function has side effects but its return value is important.
43
- // In PHPStan's criteria, these functions are simply considered as ['hasSideEffect' => true].
44
- if (isset ($ attr ->args [0 ]->value ->name ->name ) && $ attr ->args [0 ]->value ->name ->name === 'true ' ) {
45
- $ this ->impureFunctions [] = $ functionName ;
46
- } else {
47
- $ this ->functions [] = $ functionName ;
48
- }
49
- break 2 ;
41
+ if ($ attr ->name ->toString () !== Pure::class) {
42
+ continue ;
43
+ }
44
+
45
+ // PhpStorm stub's #[Pure(true)] mean sthe function has side effects but its return value is important.
46
+ // In PHPStan's criteria, these functions are simply considered as ['hasSideEffect' => true].
47
+ if (isset ($ attr ->args [0 ]->value ->name ->name ) && $ attr ->args [0 ]->value ->name ->name === 'true ' ) {
48
+ $ this ->impureFunctions [] = $ functionName ;
49
+ } else {
50
+ $ this ->functions [] = $ functionName ;
50
51
}
52
+ break 2 ;
51
53
}
52
54
}
53
55
}
You can’t perform that action at this time.
0 commit comments