diff --git a/src/com/phpuaca/annotator/StringAnnotator.java b/src/com/phpuaca/annotator/StringAnnotator.java index 48481c2..8276bb9 100644 --- a/src/com/phpuaca/annotator/StringAnnotator.java +++ b/src/com/phpuaca/annotator/StringAnnotator.java @@ -26,10 +26,14 @@ public void annotate(@NotNull PsiElement psiElement, @NotNull AnnotationHolder a Method method = phpClass.findMethodByName(name); TextRange textRange = psiElement.getTextRange(); TextRange annotationTextRange = new TextRange(textRange.getStartOffset() + 1, textRange.getEndOffset() - 1); - if (method == null && phpClass.findFieldByName(name, false) == null) { - annotationHolder.createWarningAnnotation(annotationTextRange, "Method '" + name + "' not found in class " + phpClass.getName()); - } else if (!filter.isMethodAllowed(method)) { - annotationHolder.createWarningAnnotation(annotationTextRange, "Method '" + name + "' is not allowed to use here"); + if (method == null) { + if (phpClass.findFieldByName(name, false) == null) { + annotationHolder.createWarningAnnotation(annotationTextRange, "Method '" + name + "' not found in class " + phpClass.getName()); + } + } else { + if (!filter.isMethodAllowed(method)) { + annotationHolder.createWarningAnnotation(annotationTextRange, "Method '" + name + "' is not allowed to use here"); + } } } } diff --git a/src/com/phpuaca/filter/Filter.java b/src/com/phpuaca/filter/Filter.java index 3087f9e..2efcfb6 100755 --- a/src/com/phpuaca/filter/Filter.java +++ b/src/com/phpuaca/filter/Filter.java @@ -87,7 +87,7 @@ protected boolean isMethodAllowed(String methodName) { } public boolean isMethodAllowed(Method method) { - return !(method instanceof PhpDocMethod) && isMethodAllowed(method.getName()) && isModifierAllowed(method.getModifier()); + return isMethodAllowed(method.getName()) && isModifierAllowed(method.getModifier()); } public boolean isMethodDescribed(String methodName) {