File tree Expand file tree Collapse file tree 5 files changed +24
-5
lines changed
src/com/magento/idea/magento2uct Expand file tree Collapse file tree 5 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ public Summary(
44
44
* @return String
45
45
*/
46
46
public String getInstalledVersion () {
47
- return installedVersion == null ? "" : installedVersion .getVersion ();
47
+ return installedVersion == null ? "Less than 2.3.0 " : installedVersion .getVersion ();
48
48
}
49
49
50
50
/**
Original file line number Diff line number Diff line change @@ -62,9 +62,10 @@ public UctInspectionManager(final @NotNull Project project) {
62
62
psiFile ,
63
63
false
64
64
);
65
+ final List <PsiElementVisitor > visitors = SupportedIssue .getVisitors (problemsHolder );
65
66
66
67
for (final PsiElement element : collectElements (phpClass )) {
67
- for (final PsiElementVisitor visitor : SupportedIssue . getVisitors ( problemsHolder ) ) {
68
+ for (final PsiElementVisitor visitor : visitors ) {
68
69
element .accept (visitor );
69
70
}
70
71
}
Original file line number Diff line number Diff line change @@ -161,6 +161,17 @@ public void setCurrentVersion(final @Nullable SupportedVersion version) {
161
161
return SupportedVersion .getVersion (currentVersion );
162
162
}
163
163
164
+ /**
165
+ * Get current version or default version instead.
166
+ *
167
+ * @return SupportedVersion
168
+ */
169
+ public @ NotNull SupportedVersion getCurrentVersionOrDefault () {
170
+ final SupportedVersion currentVersion = getCurrentVersion ();
171
+
172
+ return currentVersion == null ? SupportedVersion .V230 : currentVersion ;
173
+ }
174
+
164
175
/**
165
176
* Set target version.
166
177
*
Original file line number Diff line number Diff line change @@ -127,7 +127,14 @@ private void onOK() {
127
127
return ;
128
128
}
129
129
settingsService .setEnabled (enable .isSelected ());
130
- final String currentVersionValue = currentVersion .getSelectedItem ().toString ();
130
+
131
+ final ComboBoxItemData currentVersionItemData =
132
+ (ComboBoxItemData ) currentVersion .getSelectedItem ();
133
+ String currentVersionValue = "" ;
134
+
135
+ if (currentVersionItemData != null ) {
136
+ currentVersionValue = currentVersionItemData .getKey ();
137
+ }
131
138
132
139
settingsService .setCurrentVersion (
133
140
currentVersionValue .isEmpty ()
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ public static synchronized VersionStateManager getInstance(
42
42
43
43
if (instance == null
44
44
|| !instance .isValidFor (settingsService .shouldIgnoreCurrentVersion (),
45
- settingsService .getCurrentVersion (),
45
+ settingsService .getCurrentVersionOrDefault (),
46
46
settingsService .getTargetVersion ()
47
47
)) {
48
48
instance = new VersionStateManager (project );
@@ -111,7 +111,7 @@ public boolean isApi(final @NotNull String fqn) {
111
111
private VersionStateManager (final @ NotNull Project project ) {
112
112
final UctSettingsService settingsService = UctSettingsService .getInstance (project );
113
113
isSetIgnoreFlag = settingsService .shouldIgnoreCurrentVersion ();
114
- currentVersion = settingsService .getCurrentVersion ();
114
+ currentVersion = settingsService .getCurrentVersionOrDefault ();
115
115
targetVersion = settingsService .getTargetVersion ();
116
116
versionsToLoad = new LinkedList <>();
117
117
You can’t perform that action at this time.
0 commit comments