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

Remove autoloading for PHP_CodeSniffer sniff #869

Open
mk-mxp opened this issue Nov 20, 2024 · 0 comments · May be fixed by #870
Open

Remove autoloading for PHP_CodeSniffer sniff #869

mk-mxp opened this issue Nov 20, 2024 · 0 comments · May be fixed by #870
Assignees

Comments

@mk-mxp
Copy link
Contributor

mk-mxp commented Nov 20, 2024

As recommended by the maintainer of PHP_CodeSniffer, we should not add the sniff to composer autoloading.

To be honest, for sniffs, you should generally not have a Composer autoload directive, but should let PHPCS handle the autoloading as the autoloading is integral to how PHPCS translates paths vs class names vs sniff codes.

If you follow the naming conventions, this will all work fine. If you don't and Composer autoloads the file, chances are that the translation between class name vs sniff code in PHPCS will not work correctly, which brings all sorts of problems.

Originally posted by @jrfnl in #857 (comment)

@tomasnorre tomasnorre linked a pull request Nov 21, 2024 that will close this issue
@tomasnorre tomasnorre self-assigned this Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants