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 7
7
8
8
import com .intellij .psi .PsiDirectory ;
9
9
10
+ @ SuppressWarnings ({"PMD.DataClass" })
10
11
public class ModuleXmlData {
11
12
private final String packageName ;
12
13
private final String moduleName ;
@@ -53,7 +54,7 @@ public String getSetupVersion() {
53
54
return this .setupVersion ;
54
55
}
55
56
56
- public boolean getCreateModuleDirs () {
57
+ public boolean isCreateModuleDirs () {
57
58
return this .createModuleDirs ;
58
59
}
59
60
}
Original file line number Diff line number Diff line change 22
22
import com .magento .idea .magento2plugin .magento .packages .Package ;
23
23
import com .magento .idea .magento2plugin .project .Settings ;
24
24
import com .magento .idea .magento2plugin .util .CamelCaseToHyphen ;
25
- import com .magento .idea .magento2plugin .util .magento .MagentoVersion ;
25
+ import com .magento .idea .magento2plugin .util .magento .MagentoVersionUtil ;
26
26
import java .awt .event .ActionEvent ;
27
27
import java .awt .event .ActionListener ;
28
28
import java .awt .event .KeyEvent ;
@@ -244,7 +244,7 @@ public String getModuleVersion() {
244
244
*/
245
245
public String getSetupVersion () {
246
246
final String magentoVersion = getMagentoVersion ();
247
- if (!MagentoVersion .compare (magentoVersion , MAGENTO_BEFORE_DECLARATIVE_SCHEMA_VERSION )) {
247
+ if (!MagentoVersionUtil .compare (magentoVersion , MAGENTO_BEFORE_DECLARATIVE_SCHEMA_VERSION )) {
248
248
return this .moduleVersion .getText ().trim ();
249
249
}
250
250
return null ;
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ public ModuleXmlGenerator(
41
41
42
42
@ Override
43
43
public PsiFile generate (final String actionName ) {
44
- if (moduleXmlData .getCreateModuleDirs ()) {
44
+ if (moduleXmlData .isCreateModuleDirs ()) {
45
45
final ModuleDirectoriesData moduleDirectoriesData = directoryGenerator
46
46
.createOrFindModuleDirectories (
47
47
moduleXmlData .getPackageName (),
Original file line number Diff line number Diff line change 33
33
34
34
35
35
public class MagentoModuleGenerator extends WebProjectTemplate <MagentoProjectGeneratorSettings > {
36
- public static String ACTION_NAME = "Magento 2 Module" ;
36
+ public static String actionName = "Magento 2 Module" ;
37
37
38
38
@ Nls
39
39
@ NotNull
40
40
@ Override
41
41
public String getName () {
42
- return ACTION_NAME ;
42
+ return actionName ;
43
43
}
44
44
45
45
@ Override
@@ -124,7 +124,7 @@ private PsiFile generateComposerJson(
124
124
settings .getModuleLicenses (),
125
125
new ArrayList <>(),
126
126
false
127
- ), project ).generate (ACTION_NAME );
127
+ ), project ).generate (actionName );
128
128
}
129
129
130
130
/**
@@ -145,7 +145,7 @@ private PsiFile generateRegistrationPhp(
145
145
settings .getModuleName (),
146
146
baseDir ,
147
147
false
148
- ), project ).generate (ACTION_NAME );
148
+ ), project ).generate (actionName );
149
149
}
150
150
151
151
/**
@@ -169,7 +169,7 @@ private void generateModuleXml(
169
169
);
170
170
final ModuleXmlGenerator moduleXmlGenerator =
171
171
new ModuleXmlGenerator (moduleXmlData , project );
172
- moduleXmlGenerator .generate (ACTION_NAME , true );
172
+ moduleXmlGenerator .generate (actionName , true );
173
173
}
174
174
175
175
@ Nullable
Original file line number Diff line number Diff line change 19
19
import com .magento .idea .magento2plugin .indexes .IndexManager ;
20
20
import com .magento .idea .magento2plugin .magento .packages .MagentoComponentManager ;
21
21
import 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 ;
23
23
import javax .swing .event .HyperlinkEvent ;
24
24
import org .jetbrains .annotations .NotNull ;
25
25
@@ -48,7 +48,7 @@ public void hyperlinkActivated(
48
48
settings .pluginEnabled = true ;
49
49
settings .mftfSupportEnabled = true ;
50
50
settings .magentoPath = project .getBasePath ();
51
- settings .magentoVersion = MagentoVersion .get (
51
+ settings .magentoVersion = MagentoVersionUtil .get (
52
52
project ,
53
53
project .getBasePath ()
54
54
);
Original file line number Diff line number Diff line change 18
18
import com .magento .idea .magento2plugin .init .ConfigurationManager ;
19
19
import com .magento .idea .magento2plugin .magento .packages .MagentoComponentManager ;
20
20
import 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 ;
22
22
import java .awt .event .MouseAdapter ;
23
23
import java .awt .event .MouseEvent ;
24
24
import javax .swing .JButton ;
@@ -217,7 +217,7 @@ public void changedUpdate(final DocumentEvent documentEvent) {
217
217
*/
218
218
public void updateMagentoVersion () {
219
219
final String magentoPathValue = this .magentoPath .getTextField ().getText ();
220
- final String resolvedVersion = MagentoVersion .get (project , magentoPathValue );
220
+ final String resolvedVersion = MagentoVersionUtil .get (project , magentoPathValue );
221
221
magentoVersion .setText (resolvedVersion );
222
222
}
223
223
Original file line number Diff line number Diff line change 5
5
package com .magento .idea .magento2plugin .project .validator ;
6
6
7
7
import com .intellij .openapi .options .ConfigurationException ;
8
- import com .magento .idea .magento2plugin .util .magento .MagentoVersion ;
8
+ import com .magento .idea .magento2plugin .util .magento .MagentoVersionUtil ;
9
9
import com .magento .idea .magento2plugin .bundles .ValidatorBundle ;
10
10
import com .magento .idea .magento2plugin .project .SettingsForm ;
11
11
import com .magento .idea .magento2plugin .util .RegExUtil ;
@@ -42,7 +42,7 @@ public void validate() throws ConfigurationException {
42
42
throw new ConfigurationException (validatorBundle .message ("validator.notEmpty" , "Magento Version" ));
43
43
}
44
44
45
- if (!magentoVersion .matches (RegExUtil .MAGENTO_VERSION ) && !magentoVersion .equals (MagentoVersion .DEFAULT_VERSION )) {
45
+ if (!magentoVersion .matches (RegExUtil .MAGENTO_VERSION ) && !magentoVersion .equals (MagentoVersionUtil .DEFAULT_VERSION )) {
46
46
throw new ConfigurationException (validatorBundle .message ("validator.magentoVersionInvalid" ));
47
47
}
48
48
}
Original file line number Diff line number Diff line change 19
19
import com .magento .idea .magento2plugin .magento .packages .File ;
20
20
import com .magento .idea .magento2plugin .magento .packages .Package ;
21
21
22
- public final class MagentoVersion {
22
+ public final class MagentoVersionUtil {
23
23
24
24
public static final String DEFAULT_VERSION = "any" ;
25
25
26
- private MagentoVersion () {}
26
+ private MagentoVersionUtil () {}
27
27
28
28
/**
29
29
* Parse composer.json to detect Magento 2 version
You can’t perform that action at this time.
0 commit comments