phpcbf

Fix violations detected by phpcs. More information: <https://github.com/squizlabs/PHP_CodeSniffer>.

Install

All systems
curl cmd.cat/phpcbf.sh
Debian Debian
apt-get install php-codesniffer
Ubuntu
apt-get install php-codesniffer
image/svg+xml Kali Linux
apt-get install php-codesniffer
Fedora
dnf install php-pear-PHP-CodeSniffer
Windows (WSL2)
sudo apt-get update sudo apt-get install php-codesniffer
OS X
brew install php-code-sniffer
Raspbian
apt-get install php-codesniffer

Fix violations detected by phpcs. More information: <https://github.com/squizlabs/PHP_CodeSniffer>.

  • Fix issues in the specified directory (defaults to the PEAR standard):
    phpcbf path/to/directory
  • Display a list of installed coding standards:
    phpcbf -i
  • Specify a coding standard to validate against:
    phpcbf path/to/directory --standard standard
  • Specify comma-separated file extensions to include when sniffing:
    phpcbf path/to/directory --extensions file_extension(s)
  • A comma-separated list of files to load before processing:
    phpcbf path/to/directory --bootstrap file(s)
  • Don't recurse into subdirectories:
    phpcbf path/to/directory -l

© tl;dr; authors and contributors