File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -69,13 +69,13 @@ public function check(Input $input): ResultInterface
69
69
70
70
$ finder = new NodeFinder ();
71
71
72
- /** @var Function_ |null $adder */
72
+ /** @var Stmt\Class_ |null $class */
73
73
$ class = $ finder ->findFirst ($ statements , function (Node $ node ) {
74
- return $ node instanceof Stmt \Class_ && $ node ->name ->toString () === 'File ' ;
74
+ return $ node instanceof Stmt \Class_ && $ node ->name && $ node -> name ->toString () === 'File ' ;
75
75
});
76
76
77
- /** @var ClassMethod $method */
78
- $ method = $ finder ->findFirst ([$ class ], function (Node $ node ) {
77
+ /** @var ClassMethod|null $method */
78
+ $ method = $ finder ->findFirst ($ class ? [$ class] : [ ], function (Node $ node ) {
79
79
return $ node instanceof ClassMethod && $ node ->name ->toString () === 'withPermissions ' ;
80
80
});
81
81
@@ -124,4 +124,4 @@ private function isCloneOfThis(Assign $assign): bool
124
124
125
125
return $ assign ->expr ->expr ->name === 'this ' ;
126
126
}
127
- }
127
+ }
You can’t perform that action at this time.
0 commit comments