# PHPCSStandards/PHP_CodeSniffer

PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.

Repository: https://github.com/PHPCSStandards/PHP_CodeSniffer
Canonical: https://ross.abutalabs.com/products/phpcsstandards-php_codesniffer
Language: PHP
License: BSD-3-Clause
License Family: permissive
Topics: automation, cli, coding-standards, php, phpcbf, phpcs, psr1, psr12, psr2, qa, static-analysis
Last push: 2026-08-21T22:18:37+00:00

## Health v2 (maintenance only)
Score: 92/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 98, release rhythm 96, longevity 73
- inputs: {"age_days": 1030, "days_push": 12, "days_rel": 27, "gap_med": 21.0, "n_releases_24m": 19}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1551, forks 115 (observed 2026-08-28T04:05:02.113056+00:00)

## What it is
PHP_CodeSniffer is a set of two PHP scripts: phpcs tokenizes PHP files to detect violations of a defined coding standard, and phpcbf automatically corrects those violations. It is the official continuation of the abandoned squizlabs package and supports standards like PSR1 and PSR12.

## Use cases
- enforce PSR-12 coding standards on a PHP codebase
- automatically fix coding standard violations in PHP files
- run code style checks in CI pipelines
- check PHP code style before committing
- customize a coding standard for a PHP team

## When to choose
- you need to enforce or auto-fix PHP coding standards
- you want a mature, widely adopted PHP linting tool with CI integration

## When to avoid
- you need full static analysis beyond style checking (use PHPStan or Psalm)
- you are linting languages other than PHP

## Facets
- artifact type: cli-tool
- maturity: active
- function: linter, formatter, static-site-generator, cli, developer-tools
- domain: developer-tools, testing
- platform: php, cli, cross-platform
- tags: coding-standards, phpcs, phpcbf, psr12, static-analysis, code-quality, qa, command-line, automation

## Member repositories
- PHPCSStandards/PHP_CodeSniffer (main) score 92

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:02.113056+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:30:14.996247+00:00, confidence not recorded.
  - readme: https://github.com/PHPCSStandards/PHP_CodeSniffer (fetched 2026-08-28T04:05:02.113056+00:00, sha bb55b197f8fb)
- Data as of 2026-08-30T08:39:29.467469+00:00.
