File tree Expand file tree Collapse file tree 8 files changed +18
-17
lines changed
src/com/magento/idea/magento2plugin Expand file tree Collapse file tree 8 files changed +18
-17
lines changed Original file line number Diff line number Diff line change 77
88import com .intellij .psi .PsiDirectory ;
99
10+ @ SuppressWarnings ({"PMD.DataClass" })
1011public class ModuleXmlData {
1112 private final String packageName ;
1213 private final String moduleName ;
@@ -53,7 +54,7 @@ public String getSetupVersion() {
5354 return this .setupVersion ;
5455 }
5556
56- public boolean getCreateModuleDirs () {
57+ public boolean isCreateModuleDirs () {
5758 return this .createModuleDirs ;
5859 }
5960}
Original file line number Diff line number Diff line change 2222import com .magento .idea .magento2plugin .magento .packages .Package ;
2323import com .magento .idea .magento2plugin .project .Settings ;
2424import com .magento .idea .magento2plugin .util .CamelCaseToHyphen ;
25- import com .magento .idea .magento2plugin .util .magento .MagentoVersion ;
25+ import com .magento .idea .magento2plugin .util .magento .MagentoVersionUtil ;
2626import java .awt .event .ActionEvent ;
2727import java .awt .event .ActionListener ;
2828import java .awt .event .KeyEvent ;
@@ -244,7 +244,7 @@ public String getModuleVersion() {
244244 */
245245 public String getSetupVersion () {
246246 final String magentoVersion = getMagentoVersion ();
247- if (!MagentoVersion .compare (magentoVersion , MAGENTO_BEFORE_DECLARATIVE_SCHEMA_VERSION )) {
247+ if (!MagentoVersionUtil .compare (magentoVersion , MAGENTO_BEFORE_DECLARATIVE_SCHEMA_VERSION )) {
248248 return this .moduleVersion .getText ().trim ();
249249 }
250250 return null ;
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ public ModuleXmlGenerator(
4141
4242 @ Override
4343 public PsiFile generate (final String actionName ) {
44- if (moduleXmlData .getCreateModuleDirs ()) {
44+ if (moduleXmlData .isCreateModuleDirs ()) {
4545 final ModuleDirectoriesData moduleDirectoriesData = directoryGenerator
4646 .createOrFindModuleDirectories (
4747 moduleXmlData .getPackageName (),
Original file line number Diff line number Diff line change 3333
3434
3535public class MagentoModuleGenerator extends WebProjectTemplate <MagentoProjectGeneratorSettings > {
36- public static String ACTION_NAME = "Magento 2 Module" ;
36+ public static String actionName = "Magento 2 Module" ;
3737
3838 @ Nls
3939 @ NotNull
4040 @ Override
4141 public String getName () {
42- return ACTION_NAME ;
42+ return actionName ;
4343 }
4444
4545 @ Override
@@ -124,7 +124,7 @@ private PsiFile generateComposerJson(
124124 settings .getModuleLicenses (),
125125 new ArrayList <>(),
126126 false
127- ), project ).generate (ACTION_NAME );
127+ ), project ).generate (actionName );
128128 }
129129
130130 /**
@@ -145,7 +145,7 @@ private PsiFile generateRegistrationPhp(
145145 settings .getModuleName (),
146146 baseDir ,
147147 false
148- ), project ).generate (ACTION_NAME );
148+ ), project ).generate (actionName );
149149 }
150150
151151 /**
@@ -169,7 +169,7 @@ private void generateModuleXml(
169169 );
170170 final ModuleXmlGenerator moduleXmlGenerator =
171171 new ModuleXmlGenerator (moduleXmlData , project );
172- moduleXmlGenerator .generate (ACTION_NAME , true );
172+ moduleXmlGenerator .generate (actionName , true );
173173 }
174174
175175 @ Nullable
Original file line number Diff line number Diff line change 1919import com .magento .idea .magento2plugin .indexes .IndexManager ;
2020import com .magento .idea .magento2plugin .magento .packages .MagentoComponentManager ;
2121import com .magento .idea .magento2plugin .util .magento .MagentoBasePathUtil ;
22- import com .magento .idea .magento2plugin .util .magento .MagentoVersion ;
22+ import com .magento .idea .magento2plugin .util .magento .MagentoVersionUtil ;
2323import javax .swing .event .HyperlinkEvent ;
2424import org .jetbrains .annotations .NotNull ;
2525
@@ -48,7 +48,7 @@ public void hyperlinkActivated(
4848 settings .pluginEnabled = true ;
4949 settings .mftfSupportEnabled = true ;
5050 settings .magentoPath = project .getBasePath ();
51- settings .magentoVersion = MagentoVersion .get (
51+ settings .magentoVersion = MagentoVersionUtil .get (
5252 project ,
5353 project .getBasePath ()
5454 );
Original file line number Diff line number Diff line change 1818import com .magento .idea .magento2plugin .init .ConfigurationManager ;
1919import com .magento .idea .magento2plugin .magento .packages .MagentoComponentManager ;
2020import com .magento .idea .magento2plugin .project .validator .SettingsFormValidator ;
21- import com .magento .idea .magento2plugin .util .magento .MagentoVersion ;
21+ import com .magento .idea .magento2plugin .util .magento .MagentoVersionUtil ;
2222import java .awt .event .MouseAdapter ;
2323import java .awt .event .MouseEvent ;
2424import javax .swing .JButton ;
@@ -217,7 +217,7 @@ public void changedUpdate(final DocumentEvent documentEvent) {
217217 */
218218 public void updateMagentoVersion () {
219219 final String magentoPathValue = this .magentoPath .getTextField ().getText ();
220- final String resolvedVersion = MagentoVersion .get (project , magentoPathValue );
220+ final String resolvedVersion = MagentoVersionUtil .get (project , magentoPathValue );
221221 magentoVersion .setText (resolvedVersion );
222222 }
223223
Original file line number Diff line number Diff line change 55package com .magento .idea .magento2plugin .project .validator ;
66
77import com .intellij .openapi .options .ConfigurationException ;
8- import com .magento .idea .magento2plugin .util .magento .MagentoVersion ;
8+ import com .magento .idea .magento2plugin .util .magento .MagentoVersionUtil ;
99import com .magento .idea .magento2plugin .bundles .ValidatorBundle ;
1010import com .magento .idea .magento2plugin .project .SettingsForm ;
1111import com .magento .idea .magento2plugin .util .RegExUtil ;
@@ -42,7 +42,7 @@ public void validate() throws ConfigurationException {
4242 throw new ConfigurationException (validatorBundle .message ("validator.notEmpty" , "Magento Version" ));
4343 }
4444
45- if (!magentoVersion .matches (RegExUtil .MAGENTO_VERSION ) && !magentoVersion .equals (MagentoVersion .DEFAULT_VERSION )) {
45+ if (!magentoVersion .matches (RegExUtil .MAGENTO_VERSION ) && !magentoVersion .equals (MagentoVersionUtil .DEFAULT_VERSION )) {
4646 throw new ConfigurationException (validatorBundle .message ("validator.magentoVersionInvalid" ));
4747 }
4848 }
Original file line number Diff line number Diff line change 1919import com .magento .idea .magento2plugin .magento .packages .File ;
2020import com .magento .idea .magento2plugin .magento .packages .Package ;
2121
22- public final class MagentoVersion {
22+ public final class MagentoVersionUtil {
2323
2424 public static final String DEFAULT_VERSION = "any" ;
2525
26- private MagentoVersion () {}
26+ private MagentoVersionUtil () {}
2727
2828 /**
2929 * Parse composer.json to detect Magento 2 version
You can’t perform that action at this time.
0 commit comments