@Override public Collection<? extends PhpNamedElement> getBySignature(String expression, Project project) { // get back our original call int endIndex = expression.lastIndexOf(TRIM_KEY); if (endIndex == -1) { return Collections.emptySet(); } String originalSignature = expression.substring(0, endIndex); String parameter = expression.substring(endIndex + 1); // search for called method PhpIndex phpIndex = PhpIndex.getInstance(project); Collection<? extends PhpNamedElement> phpNamedElementCollections = phpIndex.getBySignature(originalSignature, null, 0); if (phpNamedElementCollections.size() == 0) { return Collections.emptySet(); } PhpNamedElement phpNamedElement = phpNamedElementCollections.iterator().next(); if (!(phpNamedElement instanceof Method)) { return Arrays.asList(phpNamedElement); } if (!new Symfony2InterfacesUtil() .isCallTo( (Method) phpNamedElement, "\\Doctrine\\Common\\Persistence\\ObjectManager", "find")) { return phpNamedElementCollections; } parameter = PhpTypeProviderUtil.getResolvedParameter(phpIndex, parameter); if (parameter == null) { return phpNamedElementCollections; } PhpClass phpClass = EntityHelper.resolveShortcutName(project, parameter); if (phpClass == null) { return phpNamedElementCollections; } return Arrays.asList(phpClass); }