Skip to content

Commit 25867b3

Browse files
698: Moved properties on top of class NewModuleDialog. Removed of function removeSubstringFormString.
1 parent 49bf302 commit 25867b3

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

src/com/magento/idea/magento2plugin/actions/generation/dialog/NewModuleDialog.java

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public class NewModuleDialog extends AbstractDialog implements ListSelectionList
5353
private static final String MODULE_VERSION = "module version";
5454
private static final String MODULE_NAME = "module name";
5555
private static final String PACKAGE_NAME = "package name";
56+
private static final String MAGENTO_BEFORE_DECLARATIVE_SCHEMA_VERSION = "2.2.11";
57+
private static final String DEFAULT_MODULE_PREFIX = "module";
5658

5759
@FieldValidation(rule = RuleRegistry.NOT_EMPTY,
5860
message = {NotEmptyRule.MESSAGE, PACKAGE_NAME})
@@ -106,8 +108,6 @@ public class NewModuleDialog extends AbstractDialog implements ListSelectionList
106108
private String detectedPackageName;
107109
private final ModuleIndex moduleIndex;
108110
private final CamelCaseToHyphen camelCaseToHyphen;
109-
private static final String MAGENTO_BEFORE_DECLARATIVE_SCHEMA_VERSION = "2.2.11";
110-
private static final String DEFAULT_MODULE_PREFIX = "module";
111111

112112
/**
113113
* Constructor.
@@ -252,22 +252,7 @@ public String getPackageName() {
252252
* @return String
253253
*/
254254
public String getModuleName() {
255-
return this.removeSubstringFormString(
256-
DEFAULT_MODULE_PREFIX, this.moduleName.getText().trim()
257-
);
258-
}
259-
260-
/**
261-
* Remove substring from string.
262-
* @param target String
263-
* @param replacement String
264-
* @return String
265-
*/
266-
private String removeSubstringFormString(
267-
final @NotNull String target, final @NotNull String replacement
268-
) {
269-
final String moduleRegex = "(?i)" + target;
270-
return replacement.replaceAll(moduleRegex, "");
255+
return this.moduleName.getText().trim();
271256
}
272257

273258
/**

0 commit comments

Comments
 (0)