File tree 1 file changed +9
-5
lines changed
Filter options
1 file changed +9
-5
lines changed
Original file line number Diff line number Diff line change @@ -30,7 +30,9 @@ public function parse(MemberAccessExpression $node)
30
30
31
31
if ($ child instanceof Variable) {
32
32
if ($ child ->getName () === 'this ' ) {
33
- if ($ child ->getParent ()->getParent () instanceof CallExpression) {
33
+ $ parent = $ child ->getParent ();
34
+
35
+ if ($ parent ?->getParent() instanceof CallExpression) {
34
36
// They are calling a method on the current class
35
37
$ result = $ this ->context ->nearestClassDefinition ();
36
38
@@ -41,12 +43,14 @@ public function parse(MemberAccessExpression $node)
41
43
continue ;
42
44
}
43
45
44
- $ propName = $ child ->getParent ()->memberName ->getFullText ($ node ->getRoot ()->getFullText ());
46
+ if ($ parent instanceof MemberAccessExpression) {
47
+ $ propName = $ parent ->memberName ->getFullText ($ node ->getRoot ()->getFullText ());
45
48
46
- $ result = $ this ->context ->searchForProperty ($ propName );
49
+ $ result = $ this ->context ->searchForProperty ($ propName );
47
50
48
- if ($ result ) {
49
- $ this ->context ->className = $ result ['types ' ][0 ] ?? null ;
51
+ if ($ result ) {
52
+ $ this ->context ->className = $ result ['types ' ][0 ] ?? null ;
53
+ }
50
54
}
51
55
52
56
continue ;
You can’t perform that action at this time.
0 commit comments