Skip to content

Commit 657169c

Browse files
author
Vitaliy
authored
Merge pull request #279 from eduard13/plugin-inspection-args
Improving the plugin's arguments inspection
2 parents 903d781 + 03c794d commit 657169c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,11 @@ private void checkParametersCompatibility(
175175
int index = 0;
176176
for (final Parameter pluginMethodParameter : pluginMethodParameters) {
177177
index++;
178-
final String declaredType = pluginMethodParameter.getDeclaredType().toString();
178+
String declaredType = pluginMethodParameter.getDeclaredType().toString();
179+
180+
if (declaredType.isEmpty()) {
181+
declaredType = pluginMethodParameter.getDocType().toString();
182+
}
179183

180184
if (index == 1) { //NOPMD
181185
final String targetClassFqn = Package.fqnSeparator.concat(targetClassName);
@@ -283,9 +287,8 @@ private void checkParametersCompatibility(
283287
final String targetMethodParameterDeclaredType =
284288
targetMethodParameter.getDeclaredType().toString();
285289

286-
if (!checkTypeIncompatibility(
287-
targetMethodParameterDeclaredType,
288-
declaredType)
290+
if (!checkTypeIncompatibility(targetMethodParameterDeclaredType, declaredType)
291+
&& !pluginMethodParameter.getText().contains("...$")
289292
) {
290293
problemsHolder.registerProblem(
291294
pluginMethodParameter,

0 commit comments

Comments
 (0)