PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
- phpcs script detects violations of a defined coding standard
- phpcbf script to automatically correct coding standard violations.
I could not get PHP CodeSniffer to play nice with Visual Studio code and the Drupal module extension so I ran both from the command line.
phpcs --standard=path/to/ruleset.xml --extensions=php,module path/to/file/example.module
phpcbf --standard=path/to/ruleset.xml --extensions=php,module path/to/file/example.module
- Log in to post comments