# PHP_CodeSniffer

> Detect and fix coding standard violations in PHP

Source: https://talira.ai/catalog/php-codesniffer-zrnhrrbz
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Command-line tool
- Categories: [developer tools / linting](https://talira.ai/categories/developer-tools/linting), [languages / php](https://talira.ai/categories/languages/php)
- Licence: BSD-3-Clause[^1]
- Pricing: Free and open source[^1]
- Pricing notes: Free and open source.
- Free tier: yes[^1]
- Plugins: yes[^2]
- Backed by: [PHPCSStandards](https://talira.ai/orgs/phpcsstandards.md)
- Creator: Squiz Pty Ltd

PHP_CodeSniffer is two [PHP](https://talira.ai/catalog/php-xgsnpvzp.md) 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.

## Links

- GitHub: https://github.com/PHPCSStandards/PHP_CodeSniffer
- Docs: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki

## 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

## Trust

Overall: 0.46 out of 1.
Signals: backing 0.50, extensibility 0.40.

- backed by PHPCSStandards
- created by Squiz Pty Ltd
- has a plugin system

Warnings:

- GitHub activity not fetched yet

## Alternatives

- [PHPStan](https://talira.ai/catalog/phpstan-5dffx9mn.md): PHP static analysis that finds bugs without running your code
- [RuboCop](https://talira.ai/catalog/rubocop-rxzhjmy8.md): A Ruby static code analyzer and formatter, based on the community Ruby style guide.
- [ESLint](https://talira.ai/catalog/eslint-0nyjt04g.md): Find and fix problems in your JavaScript code.
- [typos](https://talira.ai/catalog/typos-sxkb7c99.md): Source code spell checker

## Sources

[^1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/4.x/licence.txt (checked 23 Nov 2026)
[^2]: https://github.com/PHPCSStandards/PHP_CodeSniffer (checked 23 Nov 2026)
