Package fr.adrienbrault.idea.symfony2plugin.dic

Examples of fr.adrienbrault.idea.symfony2plugin.dic.ContainerService


                                            serviceClassName = services.get(serviceNameId).getClassName();
                                        }
                                    }

                                    if(StringUtils.isNotBlank(serviceNameId)) {
                                        services.put(serviceNameId, new ContainerService(serviceNameId, serviceClassName, true, isPrivate));
                                    }

                                }

                            }
View Full Code Here


    private static class ServiceType implements PhpTypeSignatureInterface {

        @Nullable
        public Collection<? extends PhpNamedElement> getByParameter(Project project, String parameter) {

            ContainerService containerService = ContainerCollectionResolver.getService(project, parameter);
            if(containerService != null) {
                String serviceClass = containerService.getClassName();
                if(serviceClass != null) {
                    return PhpIndex.getInstance(project).getAnyByFQN(serviceClass);
                }
            }
View Full Code Here

            this.services = new HashMap<String, ContainerService>();

            if(this.sources.contains(Source.COMPILER)) {
                for(Map.Entry<String, String> entry: ServiceXmlParserFactory.getInstance(project, XmlServiceParser.class).getServiceMap().getMap().entrySet()) {
                    services.put(entry.getKey(), new ContainerService(entry.getKey(), entry.getValue()));
                }
            }

            if(this.sources.contains(Source.INDEX)) {
                SymfonyProcessors.CollectProjectUniqueKeysStrong projectUniqueKeysStrong = new SymfonyProcessors.CollectProjectUniqueKeysStrong(project, ServicesDefinitionStubIndex.KEY, this.services.keySet());
                FileBasedIndexImpl.getInstance().processAllKeys(ServicesDefinitionStubIndex.KEY, projectUniqueKeysStrong, project);

                for(String serviceName: projectUniqueKeysStrong.getResult()) {

                    // we have higher priority on compiler, which already has safe value
                    if(!this.services.containsKey(serviceName)) {

                        List<String[]> serviceDefinitions = FileBasedIndexImpl.getInstance().getValues(ServicesDefinitionStubIndex.KEY, serviceName, GlobalSearchScope.getScopeRestrictedByFileTypes(GlobalSearchScope.allScope(project), XmlFileType.INSTANCE, YAMLFileType.YML));

                        if(serviceDefinitions.size() == 0) {
                            this.services.put(serviceName, new ContainerService(serviceName, null, true));
                        } else {
                            this.services.putAll(convertIndexToService(serviceName, serviceDefinitions));
                        }

View Full Code Here

                // 0: class name
                // 1: private: (String) "true" if presented
                if(serviceDefinitionArray.length == 0) {
                    // just a fallback should not happen, but provide at least a service name
                    serviceMap.put(serviceName, new ContainerService(serviceName, null, true));
                } else {

                    // resolve class value, it can be null or a parameter
                    String classValue = serviceDefinitionArray[0];
                    if(classValue != null && !classValue.equals("")) {
                        classValue = getParameterCollector().resolve(serviceDefinitionArray[0]);
                    }

                    if(serviceDefinitionArray.length == 1) {
                        serviceMap.put(serviceName, new ContainerService(serviceName, classValue, true));
                    }

                    if(serviceDefinitionArray.length == 2) {
                        serviceMap.put(serviceName, new ContainerService(serviceName, classValue, true, "true".equals(serviceDefinitionArray[1])));
                    }

                }

            }
View Full Code Here

                                }

                            }

                            if(StringUtils.isNotBlank(serviceName)) {
                                services.put(serviceName, new ContainerService(serviceName, serviceClass, true, isPrivate));
                            }

                        }
                    }
                }
View Full Code Here

TOP

Related Classes of fr.adrienbrault.idea.symfony2plugin.dic.ContainerService

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.