Skip to content

Commit 891a3fd

Browse files
UCT-704: Refactored messages
1 parent 654a229 commit 891a3fd

13 files changed

+65
-129
lines changed

resources/uct/bundle/inspection.properties

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,12 @@ customCode.warnings.deprecated.1338=[1338] Implemented @deprecated interface ''{
3434
customCode.warnings.deprecated.1439=[1439] Call @deprecated method ''{0}''
3535
customCode.warnings.deprecated.1534=[1534] Using @deprecated property ''{0}''
3636
customCode.warnings.deprecated.1535=[1535] Overriding @deprecated property ''{0}''
37-
customCode.critical.existence.1112=[1112] Imported non-existent class ''{0}''
38-
customCode.critical.existence.1112.changelog=[1112] Imported class ''{0}'' that is removed in the ''{1}''
39-
customCode.critical.existence.1312=[1312] Imported non-existent interface ''{0}''
40-
customCode.critical.existence.1312.changelog=[1312] Imported interface ''{0}'' that is removed in the ''{1}''
41-
customCode.critical.existence.1317=[1317] Inherited non-existent interface ''{0}''
42-
customCode.critical.existence.1317.changelog=[1317] Inherited interface ''{0}'' that is removed in the ''{1}''
43-
customCode.critical.existence.1318=[1318] Implemented non-existent interface ''{0}''
44-
customCode.critical.existence.1318.changelog=[1318] Implemented interface ''{0}'' that is removed in the ''{1}''
45-
customCode.critical.existence.1111=[1111] Extended non-existent class ''{0}''
46-
customCode.critical.existence.1111.changelog=[1111] Extended class ''{0}'' that is removed in the ''{1}''
47-
customCode.critical.existence.1215=[1215] Overridden non-existent constant ''{0}''
48-
customCode.critical.existence.1215.changelog=[1215] Overridden constant ''{0}'' that is removed in the ''{1}''
49-
customCode.critical.existence.1515=[1515] Overridden non-existent property ''{0}''
50-
customCode.critical.existence.1515.changelog=[1515] Overridden property ''{0}'' that is removed in the ''{1}''
51-
customCode.critical.existence.1410=[1410] Called non-existent method ''{0}''
52-
customCode.critical.existence.1410.changelog=[1410] Called method ''{0}'' that is removed in the ''{1}''
53-
customCode.critical.existence.1110.changelog=[1110] Used type ''{0}'' that is removed in the ''{1}''
37+
customCode.critical.existence.1112=[1112] Imported class ''{0}'' that is removed in the ''{1}''
38+
customCode.critical.existence.1312=[1312] Imported interface ''{0}'' that is removed in the ''{1}''
39+
customCode.critical.existence.1317=[1317] Inherited interface ''{0}'' that is removed in the ''{1}''
40+
customCode.critical.existence.1318=[1318] Implemented interface ''{0}'' that is removed in the ''{1}''
41+
customCode.critical.existence.1111=[1111] Extended class ''{0}'' that is removed in the ''{1}''
42+
customCode.critical.existence.1215=[1215] Overridden constant ''{0}'' that is removed in the ''{1}''
43+
customCode.critical.existence.1515=[1515] Overridden property ''{0}'' that is removed in the ''{1}''
44+
customCode.critical.existence.1410=[1410] Called method ''{0}'' that is removed in the ''{1}''
45+
customCode.critical.existence.1110=[1110] Used type ''{0}'' that is removed in the ''{1}''

src/com/magento/idea/magento2uct/inspections/php/existence/CalledNonExistentMethod.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,10 @@ protected void execute(
3131
if (VersionStateManager.getInstance(project).isExists(type)) {
3232
return;
3333
}
34-
final String removedIn = VersionStateManager.getInstance(project).getRemovedInVersion();
35-
final String message = removedIn.isEmpty()
36-
? SupportedIssue.CALLED_NON_EXISTENT_METHOD.getMessage(type)
37-
: SupportedIssue.CALLED_NON_EXISTENT_METHOD.getChangelogMessage(
38-
type, removedIn);
34+
final String message = SupportedIssue.CALLED_NON_EXISTENT_METHOD.getMessage(
35+
type,
36+
VersionStateManager.getInstance(project).getRemovedInVersion(type)
37+
);
3938

4039
if (problemsHolder instanceof UctProblemsHolder) {
4140
((UctProblemsHolder) problemsHolder).setReservedErrorCode(

src/com/magento/idea/magento2uct/inspections/php/existence/ExtendedNonExistentClass.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@ protected void execute(
3232
if (VersionStateManager.getInstance(project).isExists(parentFqn)) {
3333
return;
3434
}
35-
final String removedIn = VersionStateManager.getInstance(project).getRemovedInVersion();
36-
final String message = removedIn.isEmpty()
37-
? SupportedIssue.EXTENDED_NON_EXISTENT_CLASS.getMessage(parentFqn)
38-
: SupportedIssue.EXTENDED_NON_EXISTENT_CLASS.getChangelogMessage(
39-
parentFqn, removedIn);
35+
final String message = SupportedIssue.EXTENDED_NON_EXISTENT_CLASS.getMessage(
36+
parentFqn,
37+
VersionStateManager.getInstance(project).getRemovedInVersion(parentFqn)
38+
);
4039

4140
if (problemsHolder instanceof UctProblemsHolder) {
4241
((UctProblemsHolder) problemsHolder).setReservedErrorCode(

src/com/magento/idea/magento2uct/inspections/php/existence/ImplementedNonExistentInterface.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ protected void execute(
2828
if (VersionStateManager.getInstance(project).isExists(interfaceFqn)) {
2929
return;
3030
}
31-
final String removedIn = VersionStateManager.getInstance(project).getRemovedInVersion();
32-
final String message = removedIn.isEmpty()
33-
? SupportedIssue.IMPLEMENTED_NON_EXISTENT_INTERFACE.getMessage(interfaceFqn)
34-
: SupportedIssue.IMPLEMENTED_NON_EXISTENT_INTERFACE.getChangelogMessage(
35-
interfaceFqn, removedIn);
31+
final String message = SupportedIssue.IMPLEMENTED_NON_EXISTENT_INTERFACE.getMessage(
32+
interfaceFqn,
33+
VersionStateManager.getInstance(project).getRemovedInVersion(interfaceFqn)
34+
);
3635

3736
if (problemsHolder instanceof UctProblemsHolder) {
3837
((UctProblemsHolder) problemsHolder).setReservedErrorCode(

src/com/magento/idea/magento2uct/inspections/php/existence/ImportingNonExistentClass.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ protected void execute(
2828
if (isInterface || VersionStateManager.getInstance(project).isExists(use.getFQN())) {
2929
return;
3030
}
31-
final String removedIn = VersionStateManager.getInstance(project).getRemovedInVersion();
32-
final String message = removedIn.isEmpty()
33-
? SupportedIssue.IMPORTED_NON_EXISTENT_CLASS.getMessage(use.getFQN())
34-
: SupportedIssue.IMPORTED_NON_EXISTENT_CLASS.getChangelogMessage(
35-
use.getFQN(), removedIn);
31+
final String message = SupportedIssue.IMPORTED_NON_EXISTENT_CLASS.getMessage(
32+
use.getFQN(),
33+
VersionStateManager.getInstance(project).getRemovedInVersion(use.getFQN())
34+
);
3635

3736
if (problemsHolder instanceof UctProblemsHolder) {
3837
((UctProblemsHolder) problemsHolder).setReservedErrorCode(

src/com/magento/idea/magento2uct/inspections/php/existence/ImportingNonExistentInterface.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ protected void execute(
2828
if (!isInterface || VersionStateManager.getInstance(project).isExists(use.getFQN())) {
2929
return;
3030
}
31-
final String removedIn = VersionStateManager.getInstance(project).getRemovedInVersion();
32-
final String message = removedIn.isEmpty()
33-
? SupportedIssue.IMPORTED_NON_EXISTENT_INTERFACE.getMessage(use.getFQN())
34-
: SupportedIssue.IMPORTED_NON_EXISTENT_INTERFACE.getChangelogMessage(
35-
use.getFQN(), removedIn);
31+
final String message = SupportedIssue.IMPORTED_NON_EXISTENT_INTERFACE.getMessage(
32+
use.getFQN(),
33+
VersionStateManager.getInstance(project).getRemovedInVersion(use.getFQN())
34+
);
3635

3736
if (problemsHolder instanceof UctProblemsHolder) {
3837
((UctProblemsHolder) problemsHolder).setReservedErrorCode(

src/com/magento/idea/magento2uct/inspections/php/existence/InheritedNonExistentInterface.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ protected void execute(
2828
if (VersionStateManager.getInstance(project).isExists(interfaceFqn)) {
2929
return;
3030
}
31-
final String removedIn = VersionStateManager.getInstance(project).getRemovedInVersion();
32-
final String message = removedIn.isEmpty()
33-
? SupportedIssue.INHERITED_NON_EXISTENT_INTERFACE.getMessage(interfaceFqn)
34-
: SupportedIssue.INHERITED_NON_EXISTENT_INTERFACE.getChangelogMessage(
35-
interfaceFqn, removedIn);
31+
final String message = SupportedIssue.INHERITED_NON_EXISTENT_INTERFACE.getMessage(
32+
interfaceFqn,
33+
VersionStateManager.getInstance(project).getRemovedInVersion(interfaceFqn)
34+
);
3635

3736
if (problemsHolder instanceof UctProblemsHolder) {
3837
((UctProblemsHolder) problemsHolder).setReservedErrorCode(

src/com/magento/idea/magento2uct/inspections/php/existence/OverriddenNonExistentConstant.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ protected void execute(
3636
.concat("::")
3737
.concat(overriddenField.getName());
3838

39-
final String removedIn = VersionStateManager.getInstance(project).getRemovedInVersion();
40-
final String message = removedIn.isEmpty()
41-
? SupportedIssue.OVERRIDDEN_NON_EXISTENT_CONSTANT.getMessage(messageArg)
42-
: SupportedIssue.OVERRIDDEN_NON_EXISTENT_CONSTANT.getChangelogMessage(
43-
messageArg, removedIn);
39+
final String message = SupportedIssue.OVERRIDDEN_NON_EXISTENT_CONSTANT.getMessage(
40+
messageArg,
41+
VersionStateManager.getInstance(project).getRemovedInVersion(messageArg)
42+
);
4443

4544
if (problemsHolder instanceof UctProblemsHolder) {
4645
((UctProblemsHolder) problemsHolder).setReservedErrorCode(

src/com/magento/idea/magento2uct/inspections/php/existence/OverriddenNonExistentProperty.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ protected void execute(
3636
.concat("::")
3737
.concat(overriddenProperty.getName());
3838

39-
final String removedIn = VersionStateManager.getInstance(project).getRemovedInVersion();
40-
final String message = removedIn.isEmpty()
41-
? SupportedIssue.OVERRIDDEN_NON_EXISTENT_PROPERTY.getMessage(messageArg)
42-
: SupportedIssue.OVERRIDDEN_NON_EXISTENT_PROPERTY.getChangelogMessage(
43-
messageArg, removedIn);
39+
final String message = SupportedIssue.OVERRIDDEN_NON_EXISTENT_PROPERTY.getMessage(
40+
messageArg,
41+
VersionStateManager.getInstance(project).getRemovedInVersion(messageArg)
42+
);
4443

4544
if (problemsHolder instanceof UctProblemsHolder) {
4645
((UctProblemsHolder) problemsHolder).setReservedErrorCode(

src/com/magento/idea/magento2uct/inspections/php/existence/UsedNonExistentType.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ protected void execute(
2929
if (VersionStateManager.getInstance(project).isExists(phpClass.getFQN())) {
3030
return;
3131
}
32-
final String removedIn = VersionStateManager.getInstance(project).getRemovedInVersion();
3332
final String message = SupportedIssue.USED_NON_EXISTENT_TYPE.getMessage(
3433
phpClass.getFQN(),
35-
removedIn
34+
VersionStateManager.getInstance(project).getRemovedInVersion(phpClass.getFQN())
3635
);
3736

3837
if (problemsHolder instanceof UctProblemsHolder) {

0 commit comments

Comments
 (0)