Skip to content

Commit b237b32

Browse files
author
Vitaliy Boyko
committed
267: static fixes
1 parent c9f3c2b commit b237b32

File tree

8 files changed

+18
-17
lines changed

8 files changed

+18
-17
lines changed

src/com/magento/idea/magento2plugin/actions/generation/data/ModuleXmlData.java

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

88
import com.intellij.psi.PsiDirectory;
99

10+
@SuppressWarnings({"PMD.DataClass"})
1011
public 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
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import com.magento.idea.magento2plugin.magento.packages.Package;
2323
import com.magento.idea.magento2plugin.project.Settings;
2424
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;
2626
import java.awt.event.ActionEvent;
2727
import java.awt.event.ActionListener;
2828
import 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;

src/com/magento/idea/magento2plugin/actions/generation/generator/ModuleXmlGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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(),

src/com/magento/idea/magento2plugin/generation/php/MagentoModuleGenerator.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@
3333

3434

3535
public 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

src/com/magento/idea/magento2plugin/project/ProjectDetector.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.magento.idea.magento2plugin.indexes.IndexManager;
2020
import com.magento.idea.magento2plugin.magento.packages.MagentoComponentManager;
2121
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;
2323
import javax.swing.event.HyperlinkEvent;
2424
import 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
);

src/com/magento/idea/magento2plugin/project/SettingsForm.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import com.magento.idea.magento2plugin.init.ConfigurationManager;
1919
import com.magento.idea.magento2plugin.magento.packages.MagentoComponentManager;
2020
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;
2222
import java.awt.event.MouseAdapter;
2323
import java.awt.event.MouseEvent;
2424
import 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

src/com/magento/idea/magento2plugin/project/validator/SettingsFormValidator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
package com.magento.idea.magento2plugin.project.validator;
66

77
import com.intellij.openapi.options.ConfigurationException;
8-
import com.magento.idea.magento2plugin.util.magento.MagentoVersion;
8+
import com.magento.idea.magento2plugin.util.magento.MagentoVersionUtil;
99
import com.magento.idea.magento2plugin.bundles.ValidatorBundle;
1010
import com.magento.idea.magento2plugin.project.SettingsForm;
1111
import 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
}

src/com/magento/idea/magento2plugin/util/magento/MagentoVersion.java renamed to src/com/magento/idea/magento2plugin/util/magento/MagentoVersionUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
import com.magento.idea.magento2plugin.magento.packages.File;
2020
import 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

0 commit comments

Comments
 (0)