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

Magento2\Sniffs\Legacy\RestrictedCodeSniff doesn't catch namespaced classes #444

Open
DmitryFurs opened this issue May 5, 2023 · 1 comment
Labels
Projects

Comments

@DmitryFurs
Copy link

Preconditions

  1. Magento 2.4.5-p1
  2. Magento Coding Standard v29

Steps to reproduce

  1. Create a php file, where you include any namespaced class from restricted_classes.php for example \Magento\Framework\Serialize\Serializer\Serialize in the constructor or any other place
  2. Run code sniffer on that file.

Expected result

  1. Sniffer caught the class

Actual result

  1. Sniffer didn't catch the class

Notes

Registered tokens contain only partial values for classes, they transmit parts of this class in turn, Magento, then Framework, then Serialize, and so on, but the whole class is not transmitted. Therefore, the sniffer only works for classes that consist of a single word or are combined with an underscore _.

@DmitryFurs DmitryFurs added the bug Something isn't working label May 5, 2023
@m2-assistant
Copy link

m2-assistant bot commented May 5, 2023

Hi @DmitryFurs. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.

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

No branches or pull requests

1 participant