Package org.eclipse.php.internal.core.ast.nodes

Examples of org.eclipse.php.internal.core.ast.nodes.MethodInvocation


    ASTRewrite rewriter = ASTRewrite.create(ast);
   
    ListRewrite classListRewrite = rewriter.getListRewrite( fCoveringDeclarationFinder.getCoveringClassDeclaration().getBody(), Block.STATEMENTS_PROPERTY);
    VariableBase dispatcher = ast.newVariable(THIS_VARIABLE_NAME);
    FunctionInvocation calledExtractedMethod = ast.newFunctionInvocation(ast.newFunctionName(ast.newIdentifier(fMethodName)), computeParameters(ast));
    MethodInvocation inlineMethodCall = ast.newMethodInvocation(dispatcher, calledExtractedMethod);

    List<List<ASTNode>> Occurences = new ArrayList<List<ASTNode>>();
   
    if(fReplaceDuplicates) {
      for(Match replace : fDuplicates) {
View Full Code Here


  private String getBasicName(ASTNode node) {
    if (node != null) {
      switch (node.getType()) {
      case ASTNode.METHOD_INVOCATION:
        MethodInvocation inv = (MethodInvocation) node;
        return getBasicName(inv.getMethod());
      case ASTNode.FUNCTION_INVOCATION:
        FunctionInvocation func = (FunctionInvocation) node;
        if (func.getFunctionName() == null || func.getFunctionName().getName() == null) {
          return DEFAULT_NAME;
        }
View Full Code Here

    String str = "<?php class MyClass { public $myvar = \"test\"; public function mymethod(){ return $this->myvar; }} $a = new MyClass(); $a->mymethod();?>";
    Program program = createAndParse(str);

    ExpressionStatement statement = (ExpressionStatement) program
        .statements().get(2);
    MethodInvocation methodInvocation = (MethodInvocation) statement
        .getExpression();
    IMethodBinding methodBinding = methodInvocation.resolveMethodBinding();

    Assert.assertNotNull(methodBinding);
    Assert.assertTrue(methodBinding.getName().equals("mymethod"));
    Assert.assertNotNull(methodBinding.getDeclaringClass());
    Assert.assertTrue(methodBinding.getDeclaringClass().getName()
View Full Code Here

    String str = "<?php class MyClass { function foo(){} } $a = new MyClass(); $a->foo(); ?>";
    Program program = createAndParse(str);

    ExpressionStatement statement = (ExpressionStatement) program
        .statements().get(2);
    MethodInvocation methodInvocation = (MethodInvocation) statement
        .getExpression();

    IMethodBinding methodBinding = methodInvocation.resolveMethodBinding();
    Assert.assertNotNull(methodBinding);
    Assert.assertTrue(methodBinding.getName().equals("foo"));

    ITypeBinding declaringClass = methodBinding.getDeclaringClass();
    Assert.assertNotNull(declaringClass);
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.core.ast.nodes.MethodInvocation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.