Skip to content

Commit 4ba3a10

Browse files
check for $this->set calls only
1 parent 3b99d4c commit 4ba3a10

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/org/cakephp/netbeans/editor/CakePhpEditorExtender.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.netbeans.modules.php.editor.parser.astnodes.MethodDeclaration;
3535
import org.netbeans.modules.php.editor.parser.astnodes.MethodInvocation;
3636
import org.netbeans.modules.php.editor.parser.astnodes.Scalar;
37+
import org.netbeans.modules.php.editor.parser.astnodes.Variable;
3738
import org.openide.filesystems.FileObject;
3839

3940
/**
@@ -112,7 +113,12 @@ public void visit(MethodDeclaration node) {
112113
@Override
113114
public void visit(MethodInvocation node) {
114115
super.visit(node);
115-
116+
117+
if(!(node.getDispatcher() instanceof Variable)
118+
|| !"$this".equals(CodeUtils.extractVariableName((Variable) node.getDispatcher()))) {
119+
return;
120+
}
121+
116122
FunctionInvocation fi = node.getMethod();
117123
String invokedMethodName = CodeUtils.extractFunctionName(fi);
118124

0 commit comments

Comments
 (0)