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

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


                Map<String, String> importMap = AnnotationBackportUtil.getUseImportMap(phpDocComment);
                if(importMap.size() > 0) {
                    for(PhpDocTag phpDocTag: phpDocTags) {

                        // resolve annotation and check for template
                        PhpClass phpClass = AnnotationBackportUtil.getAnnotationReference(phpDocTag, importMap);
                        if(phpClass != null && PhpElementsUtil.isEqualClassName(phpClass, TwigHelper.TEMPLATE_ANNOTATION_CLASS)) {
                            for(Map.Entry<String, PsiElement> entry: TwigUtil.getTemplateAnnotationFiles(phpDocTag).entrySet()) {
                                if(!uniqueTemplates.contains(entry.getKey())) {
                                    parameter.add(new RelatedPopupGotoLineMarker.PopupGotoRelatedItem(entry.getValue(), TwigUtil.getFoldingTemplateNameOrCurrent(entry.getKey())).withIcon(TwigIcons.TwigFileIcon, Symfony2Icons.TWIG_LINE_MARKER));
                                    uniqueTemplates.add(entry.getKey());
View Full Code Here


            for(ContainerService containerService: getServiceCollector().collect()) {
                if(containerService.getName().equals(name)) {

                    String serviceClass = getServiceCollector().resolve(name);
                    if (serviceClass != null) {
                        PhpClass phpClass = PhpElementsUtil.getClassInterface(this.project, serviceClass);
                        if(phpClass != null) {
                            processor.process(new NavigationItemEx(phpClass, containerService.getName(), containerService.isWeak() ? Symfony2Icons.SERVICE_PRIVATE_OPACITY : Symfony2Icons.SERVICE, "Service"));
                        }
                    }
View Full Code Here

        EXTENSION, DEFAULT_OPTIONS
    }

    private FormOptionsGotoCompletionProvider getFormProvider(StringLiteralExpression psiElement, PsiElement formType) {

        PhpClass phpClass = FormUtil.getFormTypeClassOnParameter(formType);
        if (phpClass == null) {
            return new FormOptionsGotoCompletionProvider(psiElement, "form", FormOption.EXTENSION);
        }

        String presentableFQN = phpClass.getPresentableFQN();
        if(presentableFQN == null) {
            presentableFQN = "form";
        }

        return new FormOptionsGotoCompletionProvider(psiElement, presentableFQN, FormOption.EXTENSION, FormOption.DEFAULT_OPTIONS);
View Full Code Here

                    int foo = parameters.getOffset() - position.getTextRange().getStartOffset();
                    String before = position.getText().substring(0, foo);
                    String[] parts = before.split("::");

                    if(parts.length >= 1) {
                        PhpClass phpClass = PhpElementsUtil.getClassInterface(position.getProject(), parts[0]);
                        if(phpClass != null && phpClass.getPresentableFQN() != null) {
                            for(Field field: phpClass.getFields()) {
                                if(field.isConstant()) {
                                    resultSet.addElement(LookupElementBuilder.create(phpClass.getPresentableFQN() + "::" + field.getName()).withIcon(PhpIcons.CONSTANT));
                                }
                            }
                        }
                    }
View Full Code Here

            PsiElement element = psiElement.getParent();
            if(!(element instanceof StringLiteralExpression)) {
                return Collections.emptyList();
            }

            PhpClass formTypeToClass = FormUtil.getFormTypeToClass(getElement().getProject(), ((StringLiteralExpression) element).getContents());
            if(formTypeToClass == null) {
                return Collections.emptyList();
            }

            return Arrays.asList(new PsiElement[] { formTypeToClass });
View Full Code Here

        SymfonyCreateService symfonyCreateService = new SymfonyCreateService(event.getProject(), (PsiFile) psiFile);

        if(psiFile instanceof PhpFile) {

            if("ProjectViewPopup".equals(event.getPlace())) {
                PhpClass phpClass = PhpElementsUtil.getFirstClassFromFile((PhpFile) psiFile);
                if(phpClass != null) {
                    symfonyCreateService.setClassName(phpClass.getPresentableFQN());
                }
            } else {
                Object psiElement = event.getData(DataKey.create("psi.Element"));
                if(psiElement instanceof PhpClass) {
                    symfonyCreateService.setClassName(((PhpClass) psiElement).getPresentableFQN());
View Full Code Here

            String fileName = containingFile.getName();
            if(fileName.endsWith("orm.yml") || fileName.endsWith("odm.yml") || fileName.endsWith("mongodb.yml")) {
                String keyText = ((YAMLKeyValue) psiElement).getKeyText();
                if(StringUtils.isNotBlank(keyText)) {
                    PhpClass phpClass = PhpElementsUtil.getClass(psiElement.getProject(), keyText);
                    if(phpClass != null) {
                        NavigationGutterIconBuilder<PsiElement> builder = NavigationGutterIconBuilder.create(Symfony2Icons.DOCTRINE_LINE_MARKER).
                            setTargets(phpClass).
                            setTooltipText("Navigate to class");
View Full Code Here

        String fileName = containingFile.getName();
        if(!(fileName.endsWith("orm.yml") || fileName.endsWith("odm.yml") || fileName.endsWith("mongodb.yml"))) {
            return;
        }

        PhpClass phpClass = PhpElementsUtil.getClass(psiElement.getProject(), EntityHelper.getYamlOrmClass(containingFile, valueText));
        if(phpClass != null) {
            PsiFile psiFile = EntityHelper.getModelConfigFile(phpClass);
            if(psiFile != null) {

                NavigationGutterIconBuilder<PsiElement> builder = NavigationGutterIconBuilder.create(Symfony2Icons.DOCTRINE_LINE_MARKER).
View Full Code Here

    public ResolveResult[] multiResolve(boolean incompleteCode) {

        List<ResolveResult> resolveResults = new ArrayList<ResolveResult>();

        for (Map.Entry<String, String> entry: this.variants.entrySet()) {
            PhpClass phpClass = PhpElementsUtil.getClassInterface(getElement().getProject(), entry.getValue());
            if(phpClass != null) {
                resolveResults.add(new PsiElementResolveResult(phpClass));
            }
        }
View Full Code Here

    @Override
    public Object[] getVariants() {

        List<LookupElement> lookupElements = new ArrayList<LookupElement>();
        for (Map.Entry<String, String> entry: this.variants.entrySet()) {
            PhpClass phpClass = PhpElementsUtil.getClassInterface(getElement().getProject(), entry.getValue());
            if(phpClass != null) {
                lookupElements.add(LookupElementBuilder.create(entry.getKey()).withIcon(PhpIcons.CLASS).withTypeText(phpClass.getPresentableFQN()));
            }
        }

        return lookupElements.toArray();
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.