You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using static:: for private constants and methods discouraged.
Reason
In case if someone will extend the class OR create plugin for it - he will get the Undefined class constant error.
In past we had few issues related to this - magento/magento2#28797magento/magento2#29925.
We had it only with constants, but potentially the same issue could appear with static method calls.
Implementation
Detect all private constants in the class and all static:: calls to them and add warning if such case detected.
The text was updated successfully, but these errors were encountered:
Rule
Using
static::
for private constants and methods discouraged.Reason
In case if someone will extend the class OR create plugin for it - he will get the
Undefined class constant
error.In past we had few issues related to this - magento/magento2#28797 magento/magento2#29925.
We had it only with constants, but potentially the same issue could appear with static method calls.
Implementation
Detect all private constants in the class and all
static::
calls to them and add warning if such case detected.The text was updated successfully, but these errors were encountered: