use of com.jetbrains.php.lang.psi.elements.PhpNamedElement in project idea-php-typo3-plugin by cedricziel.
the class GeneralUtilityServiceTypeProvider method getBySignature.
@Override
public Collection<? extends PhpNamedElement> getBySignature(String expression, Set<String> visited, int depth, Project project) {
Collection<PhpNamedElement> phpNamedElementCollections = new ArrayList<>();
PhpIndex phpIndex = PhpIndex.getInstance(project);
CoreServiceParser serviceParser = new CoreServiceParser();
serviceParser.collect(project);
List<TYPO3ServiceDefinition> resolvedServices = serviceParser.resolve(project, expression);
if (resolvedServices == null || resolvedServices.isEmpty()) {
return phpNamedElementCollections;
}
resolvedServices.forEach(serviceDefinition -> {
Collection<PhpClass> classesByFQN = phpIndex.getClassesByFQN(serviceDefinition.getClassName());
phpNamedElementCollections.addAll(classesByFQN);
});
return phpNamedElementCollections;
}
Aggregations