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

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


            String className = YamlHelper.getYamlKeyValueAsString((YAMLCompoundValue) yamlCompoundValue, "targetEntity", false);
            if(className == null) {
                return;
            }

            PhpClass phpClass = ServiceUtil.getResolvedClassDefinition(psiElement.getProject(), className);
            if(phpClass == null) {
                return;
            }

            for(DoctrineModelField field: EntityHelper.getModelFields(phpClass)) {
View Full Code Here


            XmlAttribute classAttribute = parentXmlTag.getAttribute("class");
            if(classAttribute != null) {

                String serviceDefName = classAttribute.getValue();
                PhpClass phpClass = ServiceUtil.getResolvedClassDefinition(psiElement.getProject(), serviceDefName);

                // check type hint on constructor
                if(phpClass != null) {
                    Method constructor = phpClass.getConstructor();
                    if(constructor != null) {
                        String serviceName = ((XmlAttributeValue) psiElement).getValue();
                        attachMethodInstances(psiElement, serviceName, constructor, getArgumentIndex(currentXmlTag), holder);
                    }
                }

            }
        } else if (name.equals("call")) {

            // service/call/argument[id]

            XmlAttribute methodAttribute = parentXmlTag.getAttribute("method");
            if(methodAttribute != null) {
                String methodName = methodAttribute.getValue();
                XmlTag serviceTag = parentXmlTag.getParentTag();

                // get service class
                if(serviceTag != null && "service".equals(serviceTag.getName())) {
                    XmlAttribute classAttribute = serviceTag.getAttribute("class");
                    if(classAttribute != null) {

                        String serviceDefName = classAttribute.getValue();
                        PhpClass phpClass = ServiceUtil.getResolvedClassDefinition(psiElement.getProject(), serviceDefName);

                        // finally check method type hint
                        if(phpClass != null) {
                            Method method = PhpElementsUtil.getClassMethod(phpClass, methodName);
                            if(method != null) {
View Full Code Here

        if(parameterIndex >= constructorParameter.length) {
            return;
        }

        String className = constructorParameter[parameterIndex].getDeclaredType().toString();
        PhpClass expectedClass = PhpElementsUtil.getClassInterface(method.getProject(), className);
        if(expectedClass == null) {
            return;
        }

        PhpClass serviceParameterClass = ServiceUtil.getResolvedClassDefinition(method.getProject(), serviceName);
        if(serviceParameterClass != null && !new Symfony2InterfacesUtil().isInstanceOf(serviceParameterClass, expectedClass)) {
            holder.createWeakWarningAnnotation(target, "Expect instance of: " + expectedClass.getPresentableFQN());
        }

    }
View Full Code Here

            if(xmlTagService != null) {
                XmlAttribute xmlAttribute = xmlTagService.getAttribute("class");
                if(xmlAttribute != null) {
                    String value = xmlAttribute.getValue();
                    if(value != null && StringUtils.isNotBlank(value)) {
                        PhpClass phpClass = ServiceUtil.getResolvedClassDefinition(psiElement.getProject(), value);
                        if(phpClass != null) {
                            FormUtil.attachFormAliasesCompletions(phpClass, completionResultSet);
                        }
                    }
                }
View Full Code Here

            }
        }

        // find public method of the service class which are possible Actions
        for(Map.Entry<String, String> classDefinition: controllerClassNames.entrySet()) {
            PhpClass phpClass = PhpElementsUtil.getClass(this.phpIndex, classDefinition.getValue());
            if(phpClass != null) {
                for(Method method : phpClass.getMethods()) {
                    if(method.getAccess().isPublic() && !method.getName().startsWith("__") && !method.getName().startsWith("set")) {
                        actions.add(new ControllerAction(classDefinition.getKey() + ":" + method.getName(), method));
                    }
                }
            }
View Full Code Here

        if(StringUtils.isBlank(value)) {
            return resolveResults;
        }

        // resolve class or parameter class
        PhpClass phpClass = ServiceUtil.getResolvedClassDefinition(project, value);
        if(phpClass != null) {
            resolveResults.add(phpClass);
        }

        // get parameter def target
View Full Code Here

        ContainerCollectionResolver.ServiceCollector collector = new ContainerCollectionResolver.ServiceCollector(project, ContainerCollectionResolver.Source.COMPILER, ContainerCollectionResolver.Source.INDEX);
        for(String serviceName: taggedServices) {
            String resolvedService = collector.resolve(serviceName);
            if(resolvedService != null) {
                PhpClass phpClass = PhpElementsUtil.getClass(project, resolvedService);
                if(phpClass != null) {
                    phpClasses.add(phpClass);
                }
            }
        }
View Full Code Here

            return taggedClasses;
        }

        for(String className: taggedCompiledClasses) {
            if(!uniqueClass.contains(className)) {
                PhpClass phpClass = PhpElementsUtil.getClass(project, className);
                if(phpClass != null) {
                    taggedClasses.add(phpClass);
                }
            }
        }
View Full Code Here

        Map<String, String> uses = AnnotationBackportUtil.getUseImportMap(docComment);

        for(PhpDocTag phpDocTag: PsiTreeUtil.findChildrenOfAnyType(docComment, PhpDocTag.class)) {
            if(!AnnotationBackportUtil.NON_ANNOTATION_TAGS.contains(phpDocTag.getName())) {
                PhpClass annotationReference = AnnotationBackportUtil.getAnnotationReference(phpDocTag, uses);
                if(annotationReference != null && PhpElementsUtil.isEqualClassName(annotationReference, className)) {
                    return true;
                }
            }
View Full Code Here

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

        PhpClass phpClass = ServiceUtil.getResolvedClassDefinition(getElement().getProject(), this.className);
        if(phpClass == null) {
            return new ResolveResult[0];
        }

        Method targetMethod = PhpElementsUtil.getClassMethod(phpClass, this.method);
View Full Code Here

TOP

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

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.