Composer plugin that registers installed PHP_CodeSniffer coding standards automatically
open sourceMITfree
The PHP_CodeSniffer Standards Composer Installer Plugin (dealerdirect/phpcodesniffer-composer-installer) makes coding standards installed with Composer usable by PHP_CodeSniffer without symlinks or manual configuration. It finds every installed package of type phpcodesniffer-standard, scans them and the project for rulesets, and sets PHP_CodeSniffer's installed_paths option. You add it as a dev dependency and allow it to run in composer.json's allow-plugins.
Problems it solves
- make phpcs find the coding standards I installed with Composer
- stop symlinking PHP_CodeSniffer rulesets by hand
- set up WordPress Coding Standards for phpcs in a Composer project
Features
- Finds installed phpcodesniffer-standard packages and their rulesets
- Sets PHP_CodeSniffer's installed_paths automatically
- Works with PHP_CodeSniffer 3.x and 4.x and Composer 2.2+
Limitations
Alternatives
The same job
These do what PHP_CodeSniffer Standards Composer Installer Plugin does.
- PHP_CodeSniffer Detect and fix coding standard violations in PHP
- WordPress Coding Standards for PHP_CodeSniffer PHP_CodeSniffer rules that enforce WordPress coding conventions
- laminas-coding-standard The Laminas Project's PHP_CodeSniffer coding standard ruleset, built on PSR-12
- Easy Coding Standard (ECS) Runs PHP_CodeSniffer and PHP-CS-Fixer rules together, fast
- Slevomat Coding Standard Extra PHP_CodeSniffer sniffs for safer, cleaner and consistently formatted PHP
- PHPMD PHP Mess Detector: finds bugs and code smells in PHP
Compare PHP_CodeSniffer Standards Composer Installer Plugin with the top 3