Skip to content

Remove autoloading for PHP_CodeSniffer sniff #869

Closed
@mk-mxp

Description

@mk-mxp

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)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions