PHPCSStandards

PHPCSStandards/PHP_CodeSniffer

PHP BSD-3-Clause Dev Tools

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

1.5k stars
113 forks
active
GitHub +8 / week

1.5k

Stars

113

Forks

206

Open issues

30

Contributors

4.0.1 10 Nov 2025

AI Analysis

PHP_CodeSniffer is a static analysis tool that tokenizes PHP files and detects violations of defined coding standards, with an accompanying auto-fixer (phpcbf). It is essential infrastructure for PHP development teams and CI/CD pipelines seeking to enforce consistent code style and standards compliance. PHP developers and teams of all sizes benefit; it is not applicable to non-PHP projects.

Dev Tools Developer Tool Discovery value: 2/10
Documentation 9/10
Activity 10/10
Community 8/10
Code quality 8/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 8/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

static-analysis code-quality php-standards automation linting
Actively maintained Well documented Niche/specialized use case Popular Beginner friendly Production ready
Deep Analysis · Based on README and public signals
6d ago

Official continuation of PHP_CodeSniffer, maintained after original abandonment, provides code standard checking and auto-fixing

PHP_CodeSniffer is a static analysis tool that tokenizes PHP code and enforces coding standards via configurable rulesets. It has two components: phpcs (detection) and phpcbf (auto-correction). This repository is the official community-maintained successor to the abandoned Squizlabs original, created in November 2023. It remains widely used in PHP development teams and CI/CD pipelines as a foundational code quality tool, though adoption data is not explicitly documented in the README.

Origin

PHP_CodeSniffer was originally created by Squizlabs and became a standard tool in PHP development for enforcing PSR coding standards. The original repository was abandoned, prompting the community to fork and establish PHPCSStandards as the official continuation in November 2023. This transfer preserved the established user base and ecosystem.

Growth

Growth appears driven by the succession event itself—the project gained legitimacy as the official continuation of a widely-deployed tool. Recent activity (last push 2026-06-26, 5 stars in last 7 days) suggests steady but modest ongoing growth. The project likely benefits from existing organizational inertia rather than viral adoption; teams already using PHPCS stayed with the maintained version.

In production

Adoption not verified from README alone. No case studies, user testimonials, or deployment counts documented. Inherits credibility from being the official continuation of an established tool, but current real-world usage cannot be quantified from available metadata. The ecosystem of coding standard packages (WordPress-Coding-Standards, slevomat/coding-standard) depends on PHPCS compatibility, suggesting widespread indirect use.

Code analysis
Architecture

Based on README: two-script architecture (phpcs for detection, phpcbf for correction). Likely uses a tokenization approach to parse PHP syntax and match against configurable standard definitions. Appears to support pluggable sniff rules and custom standards. Installation options include Phar, Composer, Phive, and direct Git cloning, suggesting modular deployment.

Tests

README mentions badge for Coverage Status via Coveralls (linked to 4.x branch), but specific coverage percentage not stated. CI/CD workflows validate and test across PHP 7.2–8.5. Test infrastructure appears solid but depth unknown.

Maintenance

Last push 2026-06-26 (8 days before evaluation date), indicating active maintenance. CI workflows running (Validate, Test badges present). Repository shows regular activity. No indication of backlog decay or abandoned issues. Appears actively maintained, not stagnant.

Honest verdict

ADOPT IF: your team or project already standardizes on PHPCS, you need a maintained, officially-blessed continuation of established tooling, or you require both detection and auto-correction in a single integrated tool with PSR/PEAR standards built-in. AVOID IF: you are selecting a new code quality stack and have no existing PHPCS investment—PHP-CS-Fixer or PHPStan may better fit modern workflows depending on your priorities (auto-fixing vs. static analysis). MONITOR IF: you want to assess long-term viability of the community fork model for maintaining critical infrastructure; the project is healthy now but lacks the vendor backing the original had.

Independent dimensions

Mainstream potential

4/10

Technical importance

7/10

Adoption evidence

4/10

Risks
  • Adoption and real-world usage metrics are not publicly documented; cannot verify how many production systems depend on this fork vs. lingering on old versions.
  • Depends entirely on volunteer maintainer availability; if core maintainers reduce engagement, governance and release cadence could degrade.
  • Star count (1,527) and fork count (112) are modest relative to competing tools; suggests niche or stable (not growing) market share.
  • No explicit long-term roadmap documented in README; unclear whether new PHP language features (e.g., attributes, enums) are prioritized.
  • Community fork lacks organizational backing of original Squizlabs; potential for fragmentation if another fork emerges.
Prediction

PHPCS will likely remain a stable, maintained standard for teams already invested in it. Growth will remain modest—this is a successor-preservation project rather than a disruptive innovation. The tool will continue to serve as infrastructure for the broader PHP quality ecosystem (feeding downstream standards packages). Maintenance will remain active but not accelerating.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

PHP
98.2%
HTML
1.6%
Shell
0.2%
Batchfile
0%

Information

Language
PHP
License
BSD-3-Clause
Last updated
4d ago
Created
33mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Similar repos

WordPress

WordPress/WordPress-Coding-Standards

WordPress Coding Standards (WPCS) is a PHP_CodeSniffer ruleset that enforces...

2.8k PHP Dev Tools
slevomat

slevomat/coding-standard

Slevomat Coding Standard is a comprehensive PHP_CodeSniffer ruleset providing...

1.5k PHP Dev Tools
PHP-CS-Fixer

PHP-CS-Fixer/PHP-CS-Fixer

PHP CS Fixer is an automated tool that detects and fixes PHP coding standards...

13.5k PHP Dev Tools
PHPCompatibility

PHPCompatibility/PHPCompatibility

PHPCompatibility is a PHP_CodeSniffer standard that analyzes PHP code for...

2.3k PHP Dev Tools
phpstan

phpstan/phpstan

PHPStan is a static analysis tool for PHP that identifies bugs and type errors...

14k PHP Dev Tools
vs. alternatives
PHP-CS-Fixer (13,540 stars)

Both are PHP code quality tools. PHP-CS-Fixer focuses primarily on auto-fixing; PHPCS offers both detection and fixing. PHPCS is rule-driven (standard definitions), PHP-CS-Fixer is fixer-driven. Different philosophies; not direct replacements.

PHPStan (14,017 stars)

PHPStan is a static type analyzer; PHPCS is a style and standard enforcer. Orthogonal tools often used together. Different problem domains.

slevomat/coding-standard (1,476 stars)

Custom rulesets and sniffs for PHPCS. Depends on PHPCS as a base. Not a competitor; an extension ecosystem member.

WordPress-Coding-Standards (2,758 stars)

Standard definitions and sniffs for PHPCS. Also an ecosystem member, not a replacement.

PHPCompatibility (2,291 stars)

Sniff library for PHPCS targeting version compatibility checks. Another ecosystem consumer, not a direct competitor.