Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with PHP 8 #295

Open
karyna-t opened this issue Sep 29, 2021 · 2 comments
Open

Compatibility with PHP 8 #295

karyna-t opened this issue Sep 29, 2021 · 2 comments
Labels

Comments

@karyna-t
Copy link
Contributor

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

@karyna-t karyna-t added the bug Something isn't working label Sep 29, 2021
@xmav
Copy link
Contributor

xmav commented Sep 29, 2021

@magento export issue to Jira project AC as Story

@github-jira-sync-bot
Copy link

❌ Cannot export the issue. GitHub repo magento/magento-coding-standard is not supported in JIRA project AC and type Story.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants