String serviceName = getServiceName(psiElement);
if(StringUtils.isBlank(serviceName)) {
return;
}
PhpClass serviceParameterClass = ServiceUtil.getResolvedClassDefinition(psiElement.getProject(), getServiceName(psiElement));
if(serviceParameterClass == null) {
return;
}
Parameter[] constructorParameter = constructor.getParameters();
if(parameterIndex >= constructorParameter.length) {
return;
}
PhpClass expectedClass = PhpElementsUtil.getClassInterface(psiElement.getProject(), constructorParameter[parameterIndex].getDeclaredType().toString());
if(expectedClass == null) {
return;
}
if(!new Symfony2InterfacesUtil().isInstanceOf(serviceParameterClass, expectedClass)) {
holder.createWeakWarningAnnotation(psiElement, "Expect instance of: " + expectedClass.getPresentableFQN());
}
}