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
6969
7070 $ finder = new NodeFinder ();
7171
72- /** @var Function_ |null $adder */
72+ /** @var Stmt\Class_ |null $class */
7373 $ 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 ' ;
7575 });
7676
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 ) {
7979 return $ node instanceof ClassMethod && $ node ->name ->toString () === 'withPermissions ' ;
8080 });
8181
@@ -124,4 +124,4 @@ private function isCloneOfThis(Assign $assign): bool
124124
125125 return $ assign ->expr ->expr ->name === 'this ' ;
126126 }
127- }
127+ }
You can’t perform that action at this time.
0 commit comments