Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit b1cea11

Browse files
authored
Merge pull request #2665 from eliseacornejo/update_errors
Add some new errors and order compatibility issues
2 parents fa745a0 + 63f7c5e commit b1cea11

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

src/_includes/upgrade/uct-error-reference.md

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ These errors are reported when some of the core files are missing or do not matc
1414

1515
### Custom code
1616

17-
Critical errors of custom code compatibility are raised when the custom code is referencing entities that are not present in the target {{site.data.var.ee}} version.
17+
Critical errors are raised when the custom code is referencing entities that are not present in the target {{site.data.var.ee}} version. These errors are also reported when critical coding standards have been broken.
1818

1919
{:.error-table}
2020
| Error code | Error description | Suggested action |
@@ -35,6 +35,14 @@ Critical errors of custom code compatibility are raised when the custom code is
3535
| 1514 | Using non-existent Adobe Commerce property | Update code to use a class marked as `@api`. |
3636
| 1515 | Overriding non-existent Adobe Commerce property | Update code to use a class marked as `@api`. |
3737
| 1516 | Assignation of non-existent Adobe Commerce property | Update code to use a class marked as `@api`. Update the property access level to private if it can be used within a single class only. |
38+
| 5001 | Call-time pass-by-reference calls are prohibited | Passing by reference is not supported after PHP 5.6. |
39+
| 5002 | The opening PHP tag must be the first content in the file | Ensure there is no content in the file before the PHP opening tag. |
40+
| 5003 | Function has been deprecated | Use a replacement suggested in the error message. If the message does not suggest a replacement, a close review is needed to select an alternative function or implementation. |
41+
| 5005 | PHP syntax error | The code must be updated to comply with the PHP syntax standards. |
42+
| 5008 | Possible Magento 2 design violation. Detected a typical Magento 1.x construction | The code requires review and refactoring. Magento 1 constructions may no longer be supported by Magento 2 framework. |
43+
| 5072 | Possible Magento 2 design violation. Detected a typical Magento 1.x construction | Update construction to Magento 2 standards. |
44+
| 5076 | Cannot use in namespace as it is reserved since PHP 7 | Replace the reserved word in the namespace with a non-reserved keyword. |
45+
| 5077 | Cannot use as class name as it is reserved since PHP 7 | Replace the reserved class name with a non-reserved name. |
3846

3947
### GraphQL Schema
4048

@@ -62,9 +70,9 @@ GraphQL Schema critical issues are raised if the schema items are not present in
6270

6371
## Errors
6472

65-
### Non API references
73+
### Custom code
6674

67-
Custom code errors are raised when custom code is using the Adobe Commerce entry points that are not considered/marked as `@api`. The preserved behavior of such entry points is not guaranteed. The customization should rely on `@api` entry points instead. The functionality that is based on non-API Adobe Commerce code should be tested after the upgrade.
75+
Custom code errors are raised when custom code is using the Adobe Commerce entry points that are not considered/marked as `@api`. The preserved behavior of such entry points is not guaranteed. The customization should rely on `@api` entry points instead. The functionality that is based on non-API Adobe Commerce code should be tested after the upgrade. These errors are also reported when major coding standards have been broken.
6876

6977
{:.error-table}
7078
| Error code | Error description | Suggested action |
@@ -88,19 +96,8 @@ Custom code errors are raised when custom code is using the Adobe Commerce entry
8896
| 1524 | Using non Adobe Commerce API property | Values of the properties that are not marked as `@api` may be changed. Consider relying on the API interface method instead. |
8997
| 1525 | Overriding non Adobe Commerce API property | Values of the properties that are not marked as `@api` may be changed. Consider relying on the API interface method instead. |
9098
| 1526 | Assignation of non Adobe Commerce API property | Values of the properties that are not marked as `@api` may be changed. Consider relying on the API interface method instead. |
91-
92-
### Compatibility issues
93-
94-
{:.error-table}
95-
| Error code | Error description | Suggested action |
96-
| - | - | - |
97-
| 5001 | Call-time pass-by-reference calls are prohibited | Passing by reference is not supported after PHP 5.6. |
98-
| 5002 | The opening PHP tag must be the first content in the file | Ensure there is no content in the file before the PHP opening tag. |
99-
| 5003 | Function has been deprecated | Use a replacement suggested in the error message. If the message does not provide the replacement suggestion, this case requires a close review to select an alternative safe function or implementation. |
100-
| 5005 | PHP syntax error | The code requires to be updated to comply with the PHP interpretation. |
101-
| 5006 | Proxies and interceptors MUST never be explicitly requested in constructors | The original class should be declared as a type of the constructor parameter, the Interceptor/Proxy class will be passed by the framework dependency injection implementation. |
99+
| 5004 | Function without argument has been deprecated | Pass the input to validate as the first argument of the function. |
102100
| 5007 | The use of certain functions is discouraged | Avoid using these functions. |
103-
| 5008 | Possible Magento 2 design violation. Detected typical Magento 1.x construction | The code requires review and refactoring. Magento 1 constructions may no longer be supported by Magento 2 framework. |
104101
| 5009 | Template directives may not invoke methods. Only scalar array access is allowed | Remove method invocations from the template. |
105102
| 5010 | Template `@vars` comment block contains invalid JSON | Fix invalid JSON. |
106103
| 5011 | Template `@vars` comment block contains invalid label | Fix invalid label. |
@@ -164,12 +161,8 @@ Custom code errors are raised when custom code is using the Adobe Commerce entry
164161
| 5069 | Directive {%raw%}`{{escapehtml}}`{%endraw%} is obsolete | Use {%raw%}`{{var}}`{%endraw%} instead. |
165162
| 5070 | 3rd parameter is not needed anymore for `getChildHtml()` | Remove 3rd parameter from call to `getChildHtml()`. |
166163
| 5071 | 4th parameter is not needed anymore for `getChildHtml()` | Remove 4th parameter from call to `getChildHtml()`. |
167-
| 5072 | Possible Magento 2 design violation. Detected typical Magento 1.x construction | Update construction to Magento 2 standards. |
168164
| 5073 | Legacy table names with slash must be fixed to direct table names | Use direct table name instead. |
169-
| 5074 | Use of deprecated method `getResource()` to (save / load / delete) data detected. | Use a repository instead. |
170165
| 5075 | Application modules should not use classes from test modules | Remove usage of classes from test modules. |
171-
| 5076 | Cannot use in namespace as it is reserved since PHP 7 | Replace reserved word in namespace by another one not used by PHP as keyword. |
172-
| 5077 | Cannot use as class name as it is reserved since PHP 7 | Replace reserved word in class name by another one not used by PHP as keyword. |
173166
| 5078 | Class needs to be requested in constructor, otherwise compiler will not be able to find and generate these classes | Add class to constructor. |
174167
| 5079 | Use of var class variables is discouraged | Avoid using 'var' to declare class variable. |
175168
| 5080 | Possible raw SQL statement detected | Use repositories or data patches instead. |
@@ -178,6 +171,7 @@ Custom code errors are raised when custom code is using the Adobe Commerce entry
178171
| 5083 | Constants are not allowed as the first argument of translation function | Use string literal instead. |
179172
| 5084 | Do not initialize JS component in php | Initialize JS component in a template. |
180173
| 5085 | The use of certain functions is discouraged | Use the alternative function advised on the message instead. |
174+
| 5087 | PHP cross-version compatibility issue | Follow the suggestions from the message and check the [migration guide](https://www.php.net/manual/en/migration81.php). |
181175
| 6001 | `jQuery.andSelf()` removed | Use `jQuery.addBack()`. |
182176
| 6002 | jQuery `$.bind` and `$.unbind` are deprecated | Use `$.on` and `$.off` instead. |
183177
| 6003 | jQuery method to subscribe to event is deprecated and shouldn't be used | Use `.on("event name", fn)` method instead to subscribe to that event. |
@@ -201,7 +195,7 @@ These warnings are reported when there are minor inconsistencies in the core cod
201195

202196
### Custom code
203197

204-
Custom code warnings are raised when the references to deprecated code are detected. Such references should be replaced with the supported extension points. Pay attention to the `@see` annotation of deprecated item for recommendations.
198+
Custom code warnings are raised when the references to deprecated code are detected. Such references should be replaced with the supported extension points. Pay attention to the `@see` annotation of deprecated item for recommendations. These errors are also reported when minor coding standards have been broken.
205199

206200
{:.error-table}
207201
| Error code | Error description | Suggested action |
@@ -222,6 +216,9 @@ Custom code warnings are raised when the references to deprecated code are detec
222216
| 1534 | Using Adobe Commerce `@deprecated` property | The deprecated method will be removed in upcoming versions. Consider relying on methods declared in API interfaces instead. |
223217
| 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. |
224218
| 1536 | Assignation of Adobe Commerce `@deprecated` property | The deprecated method will be removed in upcoming versions. Consider relying on methods declared in API interfaces instead. |
219+
| 5006 | Proxies and interceptors MUST never be explicitly requested in constructors | The original class should be declared as a type of the constructor parameter. The Interceptor/Proxy class will be passed by the framework dependency injection implementation. |
220+
| 5074 | Use of deprecated method `getResource()` to (save / load / delete) data detected. | Use a repository instead. |
221+
| 5086 | Visibility is not declared on a constant | Declare the visibility on all constants. |
225222

226223
### GraphQL Schema
227224

0 commit comments

Comments
 (0)