Skip to content

Commit a78a52c

Browse files
Merge pull request magento#638 from magento/built-in-uct-project-feature
Built in UCT project feature
2 parents 1c2dcb3 + fe89e9b commit a78a52c

File tree

86 files changed

+5563
-60
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+5563
-60
lines changed

resources/META-INF/plugin.xml

+105
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,24 @@
109109
description="Copies Magento's path of file depending on file type">
110110
<add-to-group group-id="CopyFileReference" anchor="last"/>
111111
</action>
112+
<group id="UctReindexMenu">
113+
<separator/>
114+
<action id="com.magento.idea.magento2uct.actions.ReindexVersionedIndexesAction"
115+
class="com.magento.idea.magento2uct.actions.ReindexVersionedIndexesAction"
116+
text="ReindexVersionedIndexesAction"/>
117+
<add-to-group group-id="ProjectViewPopupMenu" anchor="last"/>
118+
</group>
119+
<group id="UctRunMenu">
120+
<separator/>
121+
<action id="com.magento.idea.magento2uct.actions.ConfigureUctAction"
122+
class="com.magento.idea.magento2uct.actions.ConfigureUctAction"
123+
text="Configure The Upgrade Compatibility Tool"/>
124+
<action id="com.magento.idea.magento2uct.actions.RunUpgradeCompatibilityToolAction"
125+
class="com.magento.idea.magento2uct.actions.RunUpgradeCompatibilityToolAction"
126+
text="Run The Upgrade Compatibility Tool Action"/>
127+
<separator/>
128+
<add-to-group group-id="ToolsMenu" anchor="last"/>
129+
</group>
112130
</actions>
113131

114132
<extensions defaultExtensionNs="com.intellij">
@@ -237,6 +255,93 @@
237255
enabledByDefault="true" level="WARNING"
238256
implementationClass="com.magento.idea.magento2plugin.inspections.xml.PluginAttributeTypeInspection"/>
239257

258+
<!-- UCT inspection -->
259+
<localInspection language="PHP" groupPath="UCT"
260+
shortName="ExtendingDeprecatedClass"
261+
bundle="uct.bundle.inspection" key="inspection.displayName.ExtendingDeprecatedClass"
262+
groupBundle="uct.bundle.inspection" groupKey="inspection.deprecation.group.name"
263+
enabledByDefault="false"
264+
level="WARNING"
265+
implementationClass="com.magento.idea.magento2uct.inspections.php.deprecation.ExtendingDeprecatedClass"/>
266+
<localInspection language="PHP" groupPath="UCT"
267+
shortName="ImportingDeprecatedClass"
268+
bundle="uct.bundle.inspection" key="inspection.displayName.ImportingDeprecatedClass"
269+
groupBundle="uct.bundle.inspection" groupKey="inspection.deprecation.group.name"
270+
enabledByDefault="false"
271+
level="WARNING"
272+
implementationClass="com.magento.idea.magento2uct.inspections.php.deprecation.ImportingDeprecatedClass"/>
273+
<localInspection language="PHP" groupPath="UCT"
274+
shortName="ImportingDeprecatedInterface"
275+
bundle="uct.bundle.inspection" key="inspection.displayName.ImportingDeprecatedInterface"
276+
groupBundle="uct.bundle.inspection" groupKey="inspection.deprecation.group.name"
277+
enabledByDefault="false"
278+
level="WARNING"
279+
implementationClass="com.magento.idea.magento2uct.inspections.php.deprecation.ImportingDeprecatedInterface"/>
280+
<localInspection language="PHP" groupPath="UCT"
281+
shortName="UsingDeprecatedClass"
282+
bundle="uct.bundle.inspection" key="inspection.displayName.UsingDeprecatedClass"
283+
groupBundle="uct.bundle.inspection" groupKey="inspection.deprecation.group.name"
284+
enabledByDefault="false"
285+
level="WARNING"
286+
implementationClass="com.magento.idea.magento2uct.inspections.php.deprecation.UsingDeprecatedClass"/>
287+
<localInspection language="PHP" groupPath="UCT"
288+
shortName="UsingDeprecatedInterface"
289+
bundle="uct.bundle.inspection" key="inspection.displayName.UsingDeprecatedInterface"
290+
groupBundle="uct.bundle.inspection" groupKey="inspection.deprecation.group.name"
291+
enabledByDefault="false"
292+
level="WARNING"
293+
implementationClass="com.magento.idea.magento2uct.inspections.php.deprecation.UsingDeprecatedInterface"/>
294+
<localInspection language="PHP" groupPath="UCT"
295+
shortName="UsingDeprecatedConstant"
296+
bundle="uct.bundle.inspection" key="inspection.displayName.UsingDeprecatedConstant"
297+
groupBundle="uct.bundle.inspection" groupKey="inspection.deprecation.group.name"
298+
enabledByDefault="false"
299+
level="WARNING"
300+
implementationClass="com.magento.idea.magento2uct.inspections.php.deprecation.UsingDeprecatedConstant"/>
301+
<localInspection language="PHP" groupPath="UCT"
302+
shortName="OverridingDeprecatedConstant"
303+
bundle="uct.bundle.inspection" key="inspection.displayName.OverridingDeprecatedConstant"
304+
groupBundle="uct.bundle.inspection" groupKey="inspection.deprecation.group.name"
305+
enabledByDefault="false"
306+
level="WARNING"
307+
implementationClass="com.magento.idea.magento2uct.inspections.php.deprecation.OverridingDeprecatedConstant"/>
308+
<localInspection language="PHP" groupPath="UCT"
309+
shortName="OverridingDeprecatedProperty"
310+
bundle="uct.bundle.inspection" key="inspection.displayName.OverridingDeprecatedProperty"
311+
groupBundle="uct.bundle.inspection" groupKey="inspection.deprecation.group.name"
312+
enabledByDefault="false"
313+
level="WARNING"
314+
implementationClass="com.magento.idea.magento2uct.inspections.php.deprecation.OverridingDeprecatedProperty"/>
315+
<localInspection language="PHP" groupPath="UCT"
316+
shortName="InheritedDeprecatedInterface"
317+
bundle="uct.bundle.inspection" key="inspection.displayName.InheritedDeprecatedInterface"
318+
groupBundle="uct.bundle.inspection" groupKey="inspection.deprecation.group.name"
319+
enabledByDefault="false"
320+
level="WARNING"
321+
implementationClass="com.magento.idea.magento2uct.inspections.php.deprecation.InheritedDeprecatedInterface"/>
322+
<localInspection language="PHP" groupPath="UCT"
323+
shortName="ImplementedDeprecatedInterface"
324+
bundle="uct.bundle.inspection" key="inspection.displayName.ImplementedDeprecatedInterface"
325+
groupBundle="uct.bundle.inspection" groupKey="inspection.deprecation.group.name"
326+
enabledByDefault="false"
327+
level="WARNING"
328+
implementationClass="com.magento.idea.magento2uct.inspections.php.deprecation.ImplementedDeprecatedInterface"/>
329+
<localInspection language="PHP" groupPath="UCT"
330+
shortName="CallingDeprecatedMethod"
331+
bundle="uct.bundle.inspection" key="inspection.displayName.CallingDeprecatedMethod"
332+
groupBundle="uct.bundle.inspection" groupKey="inspection.deprecation.group.name"
333+
enabledByDefault="false"
334+
level="WARNING"
335+
implementationClass="com.magento.idea.magento2uct.inspections.php.deprecation.CallingDeprecatedMethod"/>
336+
<localInspection language="PHP" groupPath="UCT"
337+
shortName="UsingDeprecatedProperty"
338+
bundle="uct.bundle.inspection" key="inspection.displayName.UsingDeprecatedProperty"
339+
groupBundle="uct.bundle.inspection" groupKey="inspection.deprecation.group.name"
340+
enabledByDefault="false"
341+
level="WARNING"
342+
implementationClass="com.magento.idea.magento2uct.inspections.php.deprecation.UsingDeprecatedProperty"/>
343+
<!-- \UCT inspection -->
344+
240345
<internalFileTemplate name="Magento Composer JSON"/>
241346
<internalFileTemplate name="Magento Registration PHP"/>
242347
<internalFileTemplate name="Magento Module XML"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body>
3+
<p>[1439] Call Adobe Commerce @deprecated method: The deprecated method will be removed in upcoming versions. Consider relying on methods declared in API interfaces instead.</p>
4+
<!-- tooltip end -->
5+
</body>
6+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body>
3+
<p>[1131] Extending from Adobe Commerce @deprecated class: The extended class will be removed in upcoming versions. Inheritance is not recommended way of extending Adobe Commerce functionality. Update code to use a class marked as @api.</p>
4+
<!-- tooltip end -->
5+
</body>
6+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body>
3+
<p>[1338] Implemented Adobe Commerce @deprecated interface: The deprecated interface will be removed in upcoming versions. Consider removing the interface inheritance, using an interface marked as @api or an interface introduced within your implementation instead.</p>
4+
<!-- tooltip end -->
5+
</body>
6+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body>
3+
<p>[1132] Importing Adobe Commerce @deprecated class: The extended class will be removed in upcoming versions. Consider using Adobe Commerce class marked as @api instead.</p>
4+
<!-- tooltip end -->
5+
</body>
6+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body>
3+
<p>[1332] Imported Adobe Commerce @deprecated interface: The deprecated interface will be removed in upcoming versions. Consider using an interface or class marked as @api instead.</p>
4+
<!-- tooltip end -->
5+
</body>
6+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body>
3+
<p>[1337] Inherited from Adobe Commerce @deprecated interface: The deprecated interface will be removed in upcoming versions. Consider removing the interface inheritance, using an interface marked as @api or an interface introduced within your implementation instead.</p>
4+
<!-- tooltip end -->
5+
</body>
6+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body>
3+
<p>[1235] Overriding Adobe Commerce @deprecated constant: The deprecated constant will be removed in upcoming versions. Consider using a constant marked as @api or a private constant within your implementation instead.</p>
4+
<!-- tooltip end -->
5+
</body>
6+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body>
3+
<p>[1535] Overriding Adobe Commerce @deprecated property: The deprecated property will be removed in upcoming versions. Consider relying on methods declared in API interfaces or using a private property within your implementation instead.</p>
4+
<!-- tooltip end -->
5+
</body>
6+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body>
3+
<p>[1134] Using Adobe Commerce @deprecated class: The extended class will be removed in upcoming versions. Consider using Adobe Commerce class marked as @api instead.</p>
4+
<!-- tooltip end -->
5+
</body>
6+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body>
3+
<p>[1234] Using Adobe Commerce @deprecated constant: The deprecated constant will be removed in upcoming versions. Consider using a constant marked as @api or a private constant within your implementation instead.</p>
4+
<!-- tooltip end -->
5+
</body>
6+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body>
3+
<p>[1334] Used Adobe Commerce @deprecated interface: The deprecated interface will be removed in upcoming versions. Consider using an interface or class marked as @api instead.</p>
4+
<!-- tooltip end -->
5+
</body>
6+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body>
3+
<p>[1534] Using Adobe Commerce @deprecated property: The deprecated method will be removed in upcoming versions. Consider relying on methods declared in API interfaces instead.</p>
4+
<!-- tooltip end -->
5+
</body>
6+
</html>
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
inspection.deprecation.group.name=Deprecation Inspections
2+
inspection.issues.description.link=Check https://devdocs.magento.com/upgrade-compatibility-tool/errors.html for a detailed list of Upgrade Compatibility Tool errors.
3+
inspection.displayName.ExtendingDeprecatedClass=Extending from @deprecated class
4+
inspection.displayName.ImportingDeprecatedClass=Importing @deprecated class
5+
inspection.displayName.ImportingDeprecatedInterface=Imported @deprecated interface
6+
inspection.displayName.UsingDeprecatedClass=Using @deprecated class
7+
inspection.displayName.UsingDeprecatedInterface=Using @deprecated interface
8+
inspection.displayName.UsingDeprecatedConstant=Using @deprecated constant
9+
inspection.displayName.OverridingDeprecatedConstant=Overriding @deprecated constant
10+
inspection.displayName.OverridingDeprecatedProperty=Overriding @deprecated property
11+
inspection.displayName.InheritedDeprecatedInterface=Inherited from @deprecated interface
12+
inspection.displayName.ImplementedDeprecatedInterface=Implemented @deprecated interface
13+
inspection.displayName.CallingDeprecatedMethod=Call @deprecated method
14+
inspection.displayName.UsingDeprecatedProperty=Using @deprecated property
15+
customCode.warnings.deprecated.1131=[1131] Extending from @deprecated class ''{0}''
16+
customCode.warnings.deprecated.1132=[1132] Importing @deprecated class ''{0}''
17+
customCode.warnings.deprecated.1134=[1134] Using @deprecated class ''{0}''
18+
customCode.warnings.deprecated.1234=[1234] Using @deprecated constant ''{0}''
19+
customCode.warnings.deprecated.1235=[1235] Overriding @deprecated constant ''{0}''
20+
customCode.warnings.deprecated.1332=[1332] Imported @deprecated interface ''{0}''
21+
customCode.warnings.deprecated.1334=[1334] Used @deprecated interface ''{0}''
22+
customCode.warnings.deprecated.1337=[1337] Inherited from @deprecated interface ''{0}''
23+
customCode.warnings.deprecated.1338=[1338] Implemented @deprecated interface ''{0}''
24+
customCode.warnings.deprecated.1439=[1439] Call @deprecated method ''{0}''
25+
customCode.warnings.deprecated.1534=[1534] Using @deprecated property ''{0}''
26+
customCode.warnings.deprecated.1535=[1535] Overriding @deprecated property ''{0}''
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

src/com/magento/idea/magento2plugin/bundles/AbstractBundle.java

+33-12
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,40 @@
88
import com.intellij.CommonBundle;
99
import java.util.ResourceBundle;
1010

11-
abstract class AbstractBundle {
12-
13-
abstract public String getBundleName();
14-
15-
public String message(String key, Object... params) {
16-
ResourceBundle BUNDLE = ResourceBundle.getBundle(getBundleName());
17-
18-
return CommonBundle.message(BUNDLE, key, params);
11+
public abstract class AbstractBundle {
12+
13+
public abstract String getBundleName();
14+
15+
/**
16+
* Get bundle message.
17+
*
18+
* @param key String
19+
* @param params Object[]
20+
*
21+
* @return String
22+
*/
23+
public String message(final String key, final Object... params) {
24+
final ResourceBundle bundle = ResourceBundle.getBundle(getBundleName());
25+
26+
return CommonBundle.message(bundle, key, params);
1927
}
2028

21-
public String messageOrDefault(String key, String defaultValue, Object... params) {
22-
ResourceBundle BUNDLE = ResourceBundle.getBundle(getBundleName());
23-
24-
return CommonBundle.messageOrDefault(BUNDLE, key, defaultValue, params);
29+
/**
30+
* Get message or default value.
31+
*
32+
* @param key String
33+
* @param defaultValue String
34+
* @param params Object[]
35+
*
36+
* @return String
37+
*/
38+
public String messageOrDefault(
39+
final String key,
40+
final String defaultValue,
41+
final Object... params
42+
) {
43+
final ResourceBundle bundle = ResourceBundle.getBundle(getBundleName());
44+
45+
return CommonBundle.messageOrDefault(bundle, key, defaultValue, params);
2546
}
2647
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
package com.magento.idea.magento2uct.actions;
7+
8+
import com.intellij.icons.AllIcons;
9+
import com.intellij.openapi.actionSystem.AnAction;
10+
import com.intellij.openapi.actionSystem.AnActionEvent;
11+
import com.intellij.openapi.project.Project;
12+
import com.magento.idea.magento2plugin.project.Settings;
13+
import com.magento.idea.magento2uct.ui.ConfigurationDialog;
14+
import org.jetbrains.annotations.NotNull;
15+
16+
public class ConfigureUctAction extends AnAction {
17+
18+
public static final String ACTION_NAME = "Configure The Upgrade Compatibility Tool";
19+
public static final String ACTION_DESCRIPTION = "Magento 2 Upgrade Compatibility Tool Settings";
20+
21+
/**
22+
* An action constructor.
23+
*/
24+
public ConfigureUctAction() {
25+
super(ACTION_NAME, ACTION_DESCRIPTION, AllIcons.Actions.InlayGear);
26+
}
27+
28+
@Override
29+
public void update(final @NotNull AnActionEvent event) {
30+
setIsAvailableForEvent(event, false);
31+
final Project project = event.getProject();
32+
33+
if (project == null || !Settings.isEnabled(project)) {
34+
return;
35+
}
36+
setIsAvailableForEvent(event, true);
37+
}
38+
39+
@Override
40+
public void actionPerformed(final @NotNull AnActionEvent event) {
41+
final Project project = event.getProject();
42+
43+
if (project == null) {
44+
return;
45+
}
46+
ConfigurationDialog.open(project);
47+
}
48+
49+
/**
50+
* Set is action available for event.
51+
*
52+
* @param event AnActionEvent
53+
* @param isAvailable boolean
54+
*/
55+
private void setIsAvailableForEvent(
56+
final @NotNull AnActionEvent event,
57+
final boolean isAvailable
58+
) {
59+
event.getPresentation().setVisible(isAvailable);
60+
event.getPresentation().setEnabled(isAvailable);
61+
}
62+
}

0 commit comments

Comments
 (0)