File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 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)
3838 $ functionName = $ node ->namespacedName ->toLowerString ();
3939 foreach ($ node ->attrGroups as $ attrGroup ) {
4040 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 ;
5051 }
52+ break 2 ;
5153 }
5254 }
5355 }
You can’t perform that action at this time.
0 commit comments