Detect and fix coding standard violations in PHP
open sourceBSD-3-Clausefree
PHP_CodeSniffer is two PHP command-line scripts: phpcs tokenizes PHP files and reports violations of a coding standard, and phpcbf fixes them automatically. It takes custom rulesets and third-party standards, and reads a project's configuration file, so teams run it in their editor and on CI. It installs as signed PHAR files or with Composer. This repository is the official continuation of the PHP_CodeSniffer that Squizlabs created and abandoned, under the same squizlabs/php_codesniffer package.
Problems it solves
- enforce a coding standard like PSR-12 across a PHP codebase
- automatically fix PHP code style violations
- check PHP code style on CI and fail the build on violations
- write my own coding standard rules for PHP
Features
- phpcs detects coding standard violations
- phpcbf fixes them automatically
- built-in standards and custom rulesets
- project configuration files
- signed PHAR downloads and Composer
Capabilities
| Has a command line tool | plan not known |
|---|---|
| Takes plugins | plan not known |
Alternatives
The same job
These do what PHP_CodeSniffer does.