Package com.jetbrains.php.lang.psi.elements

Examples of com.jetbrains.php.lang.psi.elements.MethodReference


        if (parameterList == null || !(parameterList.getContext() instanceof MethodReference)) {
            return;
        }

        MethodReference method = (MethodReference) parameterList.getContext();
        Symfony2InterfacesUtil interfacesUtil = new Symfony2InterfacesUtil();
        if (!interfacesUtil.isTranslatorCall(method)) {
            return;
        }

        int domainParameter = 2;
        if(method.getName().equals("transChoice")) {
            domainParameter = 3;
        }

        ParameterBag currentIndex = PsiElementUtils.getCurrentParameterIndex(psiElement);
        if(currentIndex == null) {
View Full Code Here


        if(!Symfony2ProjectComponent.isEnabled(element.getProject()) || !Settings.getInstance(element.getProject()).phpAnnotateTemplate) {
            return;
        }


        MethodReference methodReference = PsiElementUtils.getMethodReferenceWithFirstStringParameter(element);
        if (methodReference == null || !new Symfony2InterfacesUtil().isTemplatingRenderCall(methodReference)) {
            return;
        }

        ParameterBag parameterBag = PsiElementUtils.getCurrentParameterIndex(element.getParent());
View Full Code Here

                    if(var instanceof MethodReference) {
                        PsiElement form = var.getFirstChild();
                        if(form instanceof Variable) {
                            PsiElement varDecl = ((Variable) form).resolve();
                            if(varDecl instanceof Variable) {
                                MethodReference methodReference = PsiTreeUtil.getNextSiblingOfType(varDecl, MethodReference.class);
                                attachFormFields(methodReference, targets);
                            }
                        }
                    }


                    // nested resolve of form view; @TODO: should be some nicer
                    // 'foo2' => $form2 => $form2 = $form->createView() => $this->createForm(new Type();
                    if(var instanceof Variable) {
                        PsiElement varDecl = ((Variable) var).resolve();
                        if(varDecl instanceof Variable) {
                            MethodReference methodReference = PsiTreeUtil.getNextSiblingOfType(varDecl, MethodReference.class);
                            PsiElement scopeVar = methodReference.getFirstChild();

                            // $form2 = $form->createView()
                            if(scopeVar instanceof Variable) {
                                PsiElement varDeclParent = ((Variable) scopeVar).resolve();
                                if(varDeclParent instanceof Variable) {
View Full Code Here

        // nothing todo; no annotator enabled
        if(!Settings.getInstance(element.getProject()).phpAnnotateService && !Settings.getInstance(element.getProject()).phpAnnotateWeakService) {
            return;
        }

        MethodReference methodReference = PsiElementUtils.getMethodReferenceWithFirstStringParameter(element);
        if (methodReference == null || !new Symfony2InterfacesUtil().isContainerGetCall(methodReference)) {
            return;
        }

        String serviceName = Symfony2InterfacesUtil.getFirstArgumentStringValue(methodReference);
View Full Code Here

    protected boolean isCallTo(PsiElement e, Method[] expectedMethods, int deepness) {
        if (!(e instanceof MethodReference)) {
            return false;
        }

        MethodReference methodRef = (MethodReference) e;

        // resolve is also called on invalid php code like "use <xxx>"
        // so double check the method name before resolve the method
        if(!isMatchingMethodName(methodRef, expectedMethods)) {
            return false;
        }

        PsiReference psiReference = methodRef.getReference();
        if (null == psiReference) {
            return false;
        }

        Method method = getMultiResolvedMethod(psiReference);
View Full Code Here

TOP

Related Classes of com.jetbrains.php.lang.psi.elements.MethodReference

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.