File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -170,12 +170,16 @@ public function transform(
170170
171171 public static function getStartLineFromNode (Node $ node ): int
172172 {
173- $ line = match (true ) {
174- $ node instanceof PropertyAssignNode => self ::getStartLineFromNode ($ node ->getPropertyFetch ()),
175- $ node instanceof Node \Expr \PropertyFetch,
176- $ node instanceof Node \Expr \MethodCall => $ node ->name ->getStartLine (),
177- default => -1 ,
178- };
173+ if (
174+ $ node instanceof Node \Expr \PropertyFetch
175+ || $ node instanceof Node \Expr \MethodCall
176+ ) {
177+ $ line = $ node ->name ->getStartLine ();
178+ } elseif ($ node instanceof PropertyAssignNode) {
179+ $ line = self ::getStartLineFromNode ($ node ->getPropertyFetch ());
180+ } else {
181+ return $ node ->getStartLine ();
182+ }
179183
180184 return $ line !== -1 ? $ line : $ node ->getStartLine ();
181185 }
You can’t perform that action at this time.
0 commit comments