magento-coding-standard
magento-coding-standard copied to clipboard
Compatibility with PHP 8
Preconditions
In PHP 8, functions like token_get_all treat namespaced names as single token, e.g.
// Before: T_NS_SEPARATOR T_STRING
// After: T_NAME_FULLY_QUALIFIED
Details: https://wiki.php.net/rfc/namespaced_names_as_token
There are couple places in the code that rely on the php7-style implementation:
\Magento2\Sniffs\Exceptions\ThrowCatchSniff::getFullClassName
\Magento2\Sniffs\NamingConvention\ReservedWordsSniff::validateNamespace
Expected result
These methods should be checked and updated, the logic should work on PHP 8 as it was on PHP 7.
example from the main repo where new approach is used together with the old one: https://github.com/magento/magento2/blob/platform-health/setup/src/Magento/Setup/Module/Di/Code/Reader/FileClassScanner.php#L155
@magento export issue to Jira project AC as Story
:x: Cannot export the issue. GitHub repo magento/magento-coding-standard is not supported in JIRA project AC and type Story.