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

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


                if(phpClass == null) {
                    return;
                }

                Method method = PhpElementsUtil.getClassMethod(phpClass, "buildForm");
                if(method == null) {
                    return;
                }

                targets.addAll(getTwigTypeContainer(method));
View Full Code Here


        }

        ControllerIndex controllerIndex = new ControllerIndex(parameter.getProject());

        for(String controllerName: controllerNames) {
            Method method = controllerIndex.resolveShortcutName(controllerName);
            if(method != null) {
                variables.putAll(PhpMethodVariableResolveUtil.collectMethodVariables(method));
            }
        }
View Full Code Here

            if("default".equalsIgnoreCase(subTag.getName())) {
                XmlAttribute xmlAttr = subTag.getAttribute("key");
                if(xmlAttr != null && "_controller".equals(xmlAttr.getValue())) {
                    String actionName = subTag.getValue().getTrimmedText();
                    if(StringUtils.isNotBlank(actionName)) {
                        Method method = ControllerIndex.getControllerMethod(xmlTag.getProject(), actionName);
                        if(method != null) {
                            NavigationGutterIconBuilder<PsiElement> builder = NavigationGutterIconBuilder.create(Symfony2Icons.TWIG_CONTROLLER_LINE_MARKER).
                                setTargets(method).
                                setTooltipText("Navigate to action");
View Full Code Here

            return new PsiElement[0];
        }

        String controllerName = matcher.group(1);

        Method method = ControllerIndex.getControllerMethod(psiElement.getProject(), controllerName);
        if(method == null) {
            return new PsiElement[0];
        }

        return new PsiElement[] { method };
View Full Code Here

    }

    private void attachController(TwigFile psiElement, Collection<? super RelatedItemLineMarkerInfo> result) {

        Set<Method> methods = new HashSet<Method>();
        Method method = TwigUtil.findTwigFileController(psiElement);
        if(method != null) {
            methods.add(method);
        }

        methods.addAll(TwigUtil.getTwigFileMethodUsageOnIndex(psiElement));
View Full Code Here

            }
        }

        // provide setter fallback for non model class or or unknown methods
        String methodCamel = StringUtils.camelize(element.getContents());
        Method method = PhpElementsUtil.getClassMethod(phpClass, "set" + methodCamel);
        if(method != null) {
            psiElements.add(method);
        }

        return PsiElementResolveResult.createResults(psiElements);
View Full Code Here

                PsiElement parent = psiElement.getParent();
                if(!(parent instanceof StringLiteralExpression|| !PhpElementsUtil.getMethodReturnPattern().accepts(parent)) {
                    return null;
                }

                Method method = PsiTreeUtil.getParentOfType(psiElement, Method.class);
                if(method == null) {
                    return null;
                }

                if(!new Symfony2InterfacesUtil().isCallTo(method, "\\Symfony\\Component\\Form\\FormTypeInterface", "getParent")) {
View Full Code Here

        if(psiElement.getLanguage() != PhpLanguage.INSTANCE) {
            return Collections.emptyList();
        }

        Method method = PsiTreeUtil.getParentOfType(psiElement, Method.class);
        if(method == null || !method.getName().endsWith("Action")) {
            return Collections.emptyList();
        }

        return ControllerMethodLineMarkerProvider.getGotoRelatedItems(method);
    }
View Full Code Here

                    if(yamlHashElement != null) {
                        YAMLKeyValue yamlKeyValueController = YamlHelper.getYamlKeyValue(yamlHashElement, "_controller", true);
                        if(yamlKeyValueController != null) {

                            Method method = ControllerIndex.getControllerMethod(psiElement.getProject(), yamlKeyValueController.getValueText());
                            if(method != null) {
                                NavigationGutterIconBuilder<PsiElement> builder = NavigationGutterIconBuilder.create(Symfony2Icons.TWIG_CONTROLLER_LINE_MARKER).
                                    setTargets(method).
                                    setTooltipText("Navigate to action");
View Full Code Here

        @NotNull
        @Override
        public ResolveResult[] multiResolve(boolean b) {

            Method method = ControllerIndex.getControllerMethod(getElement().getProject(), getElement().getText());

            if(method != null) {
                return new ResolveResult[] {
                    new PhpResolveResult(method)
                };
View Full Code Here

TOP

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

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.