isaac/php-code-sniffer-standard
A PHP_CodeSniffer standard that bundles reusable coding-style rules for PHP projects, helping teams enforce consistent conventions and catch code-quality issues in local development and CI. Install via Composer and reference it in your phpcs.xml configuration.
Architecture fit: isaac/php-code-sniffer-standard is a PHP_CodeSniffer ruleset — dev-only developer tooling, not a runtime library. It has no role in application runtime, autoloading, or request handling. Fit is limited to the static-analysis layer, alongside PHPStan/Psalm and Laravel Pint. For Laravel stacks, Pint is the first-party default, so this package competes with rather than complements the standard toolchain unless deliberately scoped to non-overlapping sniffs. A TPM should frame it as a reference implementation for house style, not a strategic dependency.
Integration feasibility: Mechanically trivial: add as a require-dev dependency, reference the standard in phpcs.xml, run vendor/bin/phpcs. Effort is hours, not weeks. The real cost is decision cost — reconciling the ruleset with existing Pint/PSR-12 conventions, tuning exclusions, and absorbing false positives that block CI. TPM should budget an audit and pilot before committing.
Technical risk: Moderate-to-high, concentrated in maintenance rather than function. Upstream is archived: no patches, no PHPCS 4.x compatibility work, no PHP 8.x+ sniff updates. Zero dependents and ~10 stars mean the rules are effectively unvalidated in the wild. Version coupling to PHPCS and any slevomat/coding-standard dependency will rot against newer PHPCS majors and PHP versions. Security risk is negligible — dev-only, no runtime surface — and MIT licensing makes forking and vendoring legally clean, which is the main mitigation.
Key questions: What sniffs does the ruleset actually enforce, and how does that overlap or conflict with PSR-12, Laravel Pint defaults, or our existing standard? What are its dependencies (PHPCS major, slevomat, PHP floor), and is that set still installable on current PHP 8.2/8.3? Is the ruleset a thin wrapper we could reproduce ourselves in ~50 lines, making the package and its archived status moot? Does the org already have a style authority (Pint, internal PHPCS standard), making this duplication rather than adoption?
Stack fit: Dev-only, CI-adjacent. Target environments are local dev (Composer + IDE/PHPCS plugin), CI lint job, and optional pre-commit hooks. It never enters production images or the runtime dependency graph. In a Laravel project, place it beside Pint in require-dev, and explicitly decide which tool is authoritative — running both invites contradictory auto-fixes.
Migration path: Do not adopt wholesale. First, extract rather than depend: clone the ruleset.xml into an internal php-coding-standard package or tools/phpcs/ path under our MIT-compatible license. This neutralizes the archived risk immediately and lets us patch sniffs. Second, baseline then ratchet: run the extracted standard against an existing repo with PHPCS baseline generation so only new code must comply, avoiding a big-bang reformat. Third, reconcile with Pint: choose one formatter/standard owner. If Pint wins for Laravel, fold only non-overlapping sniffs (naming, complexity, strict types) into a PHPCS layer that runs after Pint.
Compatibility: Pin exact versions of squizlabs/php_codesniffer and any slevomat dependency in the internal package; lock the PHP floor to the org's supported matrix. Treat PHPCS major upgrades as deliberate, tested migrations, not floating ^ ranges.
Sequencing: 1) Audit the ruleset — sniff inventory plus diff vs. Pint/PSR-12 — 1–2 days. 2) Fork/vendor the ruleset into internal tooling; add to CI. 3) Pilot on one low-risk repo with baselining; measure CI runtime delta and false-positive rate. 4) Roll to additional repos only after the pilot's rule set stabilizes. 5) Publish internal docs and IDE setup. Recommendation: adopt the content, not the package; treat the package as a reference implementation to be internalized.
Maintenance: This is the central cost. An archived package means zero upstream maintenance and full ownership transfer to us — dependency bumps, PHP version bumps, and sniff fixes are all internal tickets. Budget a small recurring allocation (estimate 2–4 hours/quarter per active repo, more on PHPCS major upgrades) for a maintenance-only tooling line item. Mitigate by keeping the forked ruleset small and documented.
Support: No upstream maintainer, no issue triage, no security advisories. Internal support model is the platform/tooling team owns it. Onboarding docs and an explicit change log for the internal ruleset are prerequisites, not nice-to-haves.
Scaling: Effectively free from a compute standpoint — PHPCS runs are seconds to low minutes and scale linearly with repo size, parallelizable by directory. The scaling risk is organizational: every rule added or changed propagates to every repo, so ruleset changes need versioning and rollout discipline (semver on the internal package, deprecation windows). With zero dependents today, there is no external ecosystem to absorb or share that burden.
Failure modes: Silent CI drift from PHPCS upgrades changing default behavior — mitigate by pinning versions and upgrading deliberately. False-positive fatigue on idiomatic Laravel patterns (facades, magic methods, collection chains) — mitigate with pilot, baseline, and a documented exclusion policy with a fast path to suppress with justification. Tool collision between Pint and this standard — mitigate with a single formatter owner and scope PHPCS to non-formatting sniffs. PHP version rot — mitigate with a vendored fork tested against the supported PHP matrix in CI. Bus factor — mitigate by keeping the forked ruleset small, documented, and reviewed like code.
Ramp-up: Low. Any PHP developer familiar with PHPCS or Pint can run and interpret it; expect under an hour of onboarding per engineer, dominated by “which tool is authoritative” and “how do I suppress a rule” rather than the tool itself. The platform/tooling owner needs roughly a day to internalize the ruleset and CI wiring.
Bottom line for a TPM: Low opportunity, high ownership. The value is the ruleset content, not the artifact; the archived status and near-zero adoption make direct dependency the wrong call. Fork or reproduce, scope to dev tooling, sequence behind a pilot, and fund a small standing maintenance allocation. Approve as an internal tooling initiative only.
How can I help you explore Laravel packages today?