Skip to main content

Tokenize PHP, JavaScript and CSS files to detect violations of a defined set of coding standards.

# To sniff the specified directory for issues (defaults to the PEAR standard):
phpcs <path/to/directory>

# To display a list of installed coding standards:
phpcs -i

# To specify a coding standard to validate against:
phpcs <path/to/directory> --standard <standard>

# To specify file extension(s) to include when sniffing:
phpcs <path/to/directory> --extensions <file_extension(s)>

# To specify the format of the output report (e.g. 'full', 'xml', 'json', 'summary'):
phpcs <path/to/directory> --report <format>

# To set config variables to be used during the process:
phpcs <path/to/directory> --config-set <key> <value>

# To a comma-separated list of files to load before processing:
phpcs <path/to/directory> --bootstrap <file(s)>

# To don't recurse into subdirectories:
phpcs <path/to/directory> -l