30
30
import java .util .ArrayList ;
31
31
import org .jetbrains .annotations .NotNull ;
32
32
33
- @ SuppressWarnings ({"PMD.ExcessiveMethodLength" , "PMD.NPathComplexity" })
33
+ @ SuppressWarnings ({"PMD.ExcessiveMethodLength" , "PMD.NPathComplexity" , "PMD.CognitiveComplexity" })
34
34
public class PluginInspection extends PhpInspection {
35
35
36
36
private static final String WRONG_PARAM_TYPE = "inspection.wrong_param_type" ;
37
37
38
- @ NotNull
39
38
@ Override
40
- public PsiElementVisitor buildVisitor (
39
+ public @ NotNull PsiElementVisitor buildVisitor (
41
40
final @ NotNull ProblemsHolder problemsHolder ,
42
41
final boolean isOnTheFly
43
42
) {
@@ -146,7 +145,7 @@ private void checkTargetMethod(
146
145
final String targetClassMethodName ,
147
146
final Method targetMethod
148
147
) {
149
- if (targetClassMethodName . equals ( MagentoPhpClass .CONSTRUCT_METHOD_NAME )) {
148
+ if (MagentoPhpClass .CONSTRUCT_METHOD_NAME . equals ( targetClassMethodName )) {
150
149
problemsHolder .registerProblem (
151
150
pluginMethod .getNameIdentifier (),
152
151
inspectionBundle .message ("inspection.plugin.error.constructMethod" ),
@@ -167,7 +166,7 @@ private void checkTargetMethod(
167
166
ProblemHighlightType .ERROR
168
167
);
169
168
}
170
- if (!targetMethod .getAccess ().toString (). equals ( AbstractPhpFile . PUBLIC_ACCESS )) {
169
+ if (!AbstractPhpFile . PUBLIC_ACCESS . equals ( targetMethod .getAccess ().toString ())) {
171
170
problemsHolder .registerProblem (
172
171
pluginMethod .getNameIdentifier (),
173
172
inspectionBundle .message ("inspection.plugin.error.nonPublicMethod" ),
@@ -279,7 +278,7 @@ private void checkParametersCompatibility(
279
278
if (declaredType .isEmpty ()) {
280
279
continue ;
281
280
}
282
- if (!declaredType . equals ( MagentoPhpClass .PHP_NULL )) {
281
+ if (!MagentoPhpClass .PHP_NULL . equals ( declaredType )) {
283
282
problemsHolder .registerProblem (
284
283
pluginMethodParameter ,
285
284
PhpBundle .message (
0 commit comments