webtoolshealth/php-coding-standard
A PHP coding standard package from webtoolshealth that provides rules and configuration for enforcing consistent code style across projects. Use it with PHP code sniffer tooling to catch style issues, align teams on conventions, and keep PHP codebases clean and maintainable.
What it actually is. webtoolshealth/php-coding-standard is not a runtime library — it is a PHP_CodeSniffer ruleset, i.e. a ruleset.xml (plus a composer.json and probably a README) that composes upstream standards into one opinionated preset. Its only job is to be registered into PHPCS's installed_paths and referenced by <rule ref="WebtoolsHealth"/> in a project's phpcs.xml. Treat it as configuration-as-a-package, not as a dependency with a service contract.
Architecture fit. Good in principle: PHPCS rulesets are the canonical way to share lint policy across a polyrepo of Laravel services, and a require-dev package is the cleanest distribution channel. The fit is poor on timing. The package is archived, its last release was June 2021, it has 1 star and 0 dependents, and an opportunity score of 11.87. That profile means "abandoned artefact from one company's internal toolchain," not "community standard." Any Laravel stack on PHP 8.2+ and PHP_CodeSniffer 3.7+ is running a toolchain roughly four years newer than this ruleset was validated against — and PHPCS 4.x, which is a breaking major, is entirely outside its tested envelope.
Integration feasibility. Mechanically trivial. Three steps: composer require --dev webtoolshealth/php-coding-standard, add the package's src/ (or repo root) to installed_paths, and reference the standard name in phpcs.xml. Realistically 15–30 minutes including a baseline run. The friction is not installation, it is dependency resolution: the package's composer.json will pin a squizlabs/php_codesniffer constraint (likely ^3.5 or ^3.6) and possibly upstream rulesets (slevomat/coding-standard, symfony/...). Those pins were frozen in 2021 and will fight a modern project's composer update, especially if the repo also carries Pint, PHPStan, or Rector with their own PHPCS-adjacent constraints.
Technical risk. Medium-high, concentrated in four areas:
| Risk | Severity | Notes |
|---|---|---|
| PHPCS major-version drift | High | 2021-era ruleset vs. PHPCS 4.x tokenizer/API changes; sniff references may break or silently no-op |
| Transitive pin conflicts | High | Frozen 2021 constraints block Composer resolution or force older tooling across the monorepo |
| Silent rule decay | Medium | Sniff behaviour and defaults changed upstream; ruleset yields different results than intended without any commit to this repo |
| Abandonment | Certain | Archived, no issue triage, no security or compatibility patching, ever |
Key questions to answer before any decision. (1) What does the ruleset.xml actually contain — is it 20 hand-written custom sniffs, or a thin <rule ref="SlevomatCodingStandard"/> wrapper with a handful of exclusions? The answer entirely determines whether it is worth adopting. (2) Which PHPCS version constraint does its composer.json declare, and does it resolve on our target PHP/PHPCS pair? (3) Do the bespoke rules encode genuinely valuable house conventions (e.g. Laravel-specific naming, strict-types enforcement) that our team would otherwise have to write? (4) Is the standard PSR-12/PSR-4 aligned, or does it diverge in ways that would force reformatting churn on existing code? (5) Who at WT Health owns it, and is there any informal path to unarchive or fork?
Verdict. Do not adopt as a live Composer dependency. Its value is as source material: read the ruleset.xml, harvest any non-obvious rule choices, and re-express them in a file we own.
Stack fit. Target environment is a Laravel estate already running PHP_CodeSniffer (directly or via squizlabs/php_codesniffer), almost certainly alongside Laravel Pint. Note the overlap: Pint ships a Laravel preset built on PHP-CS-Fixer, which auto-fixes; PHPCS detects. Running both with divergent rule sets produces contradictory CI signals. Decide up front whether this ruleset supplements Pint (detection of things Pint cannot fix) or replaces it. Given the package's age, supplementing is the only credible posture.
Migration path. Two options, and the second is strongly preferred:
require-dev the package at its 2021 tag, pin PHPCS to the package's declared constraint. Fast, but imports the frozen-transitive-conflict problem and gives us zero maintenance leverage.ruleset.xml into a first-party path (e.g. tools/phpcs/WebtoolsHealth/) or a small internal acme/php-coding-standard package we control. We then own the PHPCS constraint, can regenerate against 3.13/4.x, can delete rules that no longer apply, and keep the standard name in phpcs.xml stable so no project files churn later. Attribution cost is a line in the README; MIT makes this clean.Compatibility. Assume PHPCS 3.x only until proven otherwise. Before migrating, run composer why-not squizlabs/php_codesniffer "^3.13" in a scratch clone — if it refuses to resolve, decision 2 is forced. Verify the standard loads on the PHP version in production (phpcs -i should list it). Watch for sniffs that reference removed tokens or use T_* constants deprecated between 3.5 and 3.13.
Sequencing.
--report=summary. Capture the rule inventory and the violation count per sniff.|| true, report uploaded as artifact).Maintenance. Ownership transfers fully to us the moment we vendor it — which is the correct outcome, because the upstream owner has already stopped. Budget roughly 2–4 engineer-hours per PHPCS major upgrade and 1 hour per quarter of drift review. If we instead take the direct dependency, maintenance cost is not lower; it is deferred and then paid at a worse time, when a PHPCS 4 upgrade collides with a composer resolution wall across every repo at once.
Support. No upstream support, no issue tracker responsiveness, no security patching. This is acceptable for a dev-only linter because the blast radius is CI, not production — no runtime code, no autoloaded classes, no attack surface. That is the single strongest argument in the package's favour: a stale dev dependency is a productivity tax, not an incident.
Scaling. Per-repo require-dev scales linearly and fine for tens of repos. The real scaling cost is CI minutes: PHPCS on a mid-size Laravel app is 30–90 seconds, and multiplying that across 40 pipelines on every PR adds up. Mitigate with parallel processing (--parallel), diff-only enforcement via a changed-files wrapper, or a centralized scheduled full-scan nightly rather than per-PR. Central distribution via an internal Composer registry or a shared CI orb keeps the standard consistent as the repo count grows.
Failure modes to instrument for.
--no-verify.Ramp-up. Near zero for developers already on PHPCS: the mental model (run phpcs, read violations, optionally phpcbf) is unchanged and the standard name is opaque to them. If the team is Pint-only, expect a half-day of orientation on detect-vs-fix semantics and one retro cycle where the team argues about specific sniffs — that argument is the actual adoption cost, and it happens whether the ruleset came from WT Health or was written internally. Framing the internal fork as "our standard, crediting WT Health's starting point" is worth more culturally than the marginal effort of copying a file.
How can I help you explore Laravel packages today?