Skip to content

Commit 4fd849e

Browse files
630: Fixed wrong array type for method arguments
1 parent 3fc2247 commit 4fd849e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/com/magento/idea/magento2plugin/actions/generation/generator/code/util/ConvertPluginParamsToString.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import com.intellij.openapi.project.Project;
99
import com.intellij.openapi.util.text.StringUtil;
10+
import com.intellij.openapi.util.text.Strings;
1011
import com.intellij.psi.PsiElement;
1112
import com.jetbrains.php.codeInsight.PhpCodeInsightUtil;
1213
import com.jetbrains.php.config.PhpLanguageFeature;
@@ -52,7 +53,11 @@ public static String execute(
5253
String returnType = PhpTypeMetadataParserUtil.getMethodReturnType(myMethod);
5354

5455
if (returnType != null && PhpClassGeneratorUtil.isValidFqn(returnType)) {
55-
returnType = PhpClassGeneratorUtil.getNameFromFqn(returnType);
56+
if (Strings.endsWith(returnType, "[]")) {
57+
returnType = "array";
58+
} else {
59+
returnType = PhpClassGeneratorUtil.getNameFromFqn(returnType);
60+
}
5661
}
5762
final Iterator<PsiElement> parametersIterator = parameters.iterator();
5863
int iterator = 0;

0 commit comments

Comments
 (0)