Skip to content

Commit 100f04a

Browse files
739: Code refactoring
1 parent eb8e209 commit 100f04a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/com/magento/idea/magento2plugin/inspections/php/PluginInspection.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,13 @@
3030
import java.util.ArrayList;
3131
import org.jetbrains.annotations.NotNull;
3232

33-
@SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"})
33+
@SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity", "PMD.CognitiveComplexity"})
3434
public class PluginInspection extends PhpInspection {
3535

3636
private static final String WRONG_PARAM_TYPE = "inspection.wrong_param_type";
3737

38-
@NotNull
3938
@Override
40-
public PsiElementVisitor buildVisitor(
39+
public @NotNull PsiElementVisitor buildVisitor(
4140
final @NotNull ProblemsHolder problemsHolder,
4241
final boolean isOnTheFly
4342
) {
@@ -146,7 +145,7 @@ private void checkTargetMethod(
146145
final String targetClassMethodName,
147146
final Method targetMethod
148147
) {
149-
if (targetClassMethodName.equals(MagentoPhpClass.CONSTRUCT_METHOD_NAME)) {
148+
if (MagentoPhpClass.CONSTRUCT_METHOD_NAME.equals(targetClassMethodName)) {
150149
problemsHolder.registerProblem(
151150
pluginMethod.getNameIdentifier(),
152151
inspectionBundle.message("inspection.plugin.error.constructMethod"),
@@ -167,7 +166,7 @@ private void checkTargetMethod(
167166
ProblemHighlightType.ERROR
168167
);
169168
}
170-
if (!targetMethod.getAccess().toString().equals(AbstractPhpFile.PUBLIC_ACCESS)) {
169+
if (!AbstractPhpFile.PUBLIC_ACCESS.equals(targetMethod.getAccess().toString())) {
171170
problemsHolder.registerProblem(
172171
pluginMethod.getNameIdentifier(),
173172
inspectionBundle.message("inspection.plugin.error.nonPublicMethod"),
@@ -279,7 +278,7 @@ private void checkParametersCompatibility(
279278
if (declaredType.isEmpty()) {
280279
continue;
281280
}
282-
if (!declaredType.equals(MagentoPhpClass.PHP_NULL)) {
281+
if (!MagentoPhpClass.PHP_NULL.equals(declaredType)) {
283282
problemsHolder.registerProblem(
284283
pluginMethodParameter,
285284
PhpBundle.message(

0 commit comments

Comments
 (0)