File tree 1 file changed +12
-0
lines changed
Filter options
1 file changed +12
-0
lines changed
Original file line number Diff line number Diff line change 5
5
use App \Contexts \AbstractContext ;
6
6
use App \Contexts \AssignmentValue ;
7
7
use App \Contexts \MethodCall ;
8
+ use Microsoft \PhpParser \Node \Expression \CallExpression ;
8
9
use Microsoft \PhpParser \Node \Expression \MemberAccessExpression ;
9
10
use Microsoft \PhpParser \Node \Expression \Variable ;
10
11
use Microsoft \PhpParser \Node \QualifiedName ;
@@ -29,6 +30,17 @@ public function parse(MemberAccessExpression $node)
29
30
30
31
if ($ child instanceof Variable) {
31
32
if ($ child ->getName () === 'this ' ) {
33
+ if ($ node ->getParent () instanceof CallExpression) {
34
+ // They are calling a method on the current class
35
+ $ result = $ this ->context ->nearestClassDefinition ();
36
+
37
+ if ($ result ) {
38
+ $ this ->context ->className = $ result ->className ;
39
+ }
40
+
41
+ continue ;
42
+ }
43
+
32
44
$ propName = $ child ->getParent ()->memberName ->getFullText ($ node ->getRoot ()->getFullText ());
33
45
34
46
$ result = $ this ->context ->searchForProperty ($ propName );
You can’t perform that action at this time.
0 commit comments