alleyinteractive/alley-coding-standards
A Composer package offering Alley Interactive’s PHP_CodeSniffer coding standards for WordPress and PHP projects. It provides rulesets to enforce consistent style and best practices, helping teams standardize reviews and CI checks.
Package: alleyinteractive/alley-coding-standards — a PHP_CodeSniffer ruleset (coding standard) for WordPress-oriented PHP, distributed via Composer/Packagist. It is developer tooling, not runtime code.
Architecture fit: No runtime coupling — it plugs into the PHPCS engine consumed by CI, pre-commit hooks, and IDEs. For Laravel/PHP services that also ship WordPress code (headless WP backends, WP-via-Composer integrations, plugin/theme repos), it fits cleanly as a dev-only dependency. For pure Laravel codebases it is largely irrelevant; the value is confined to the WordPress surface.
Integration feasibility: Low effort. composer require --dev, reference the standard in phpcs.xml.dist, exclude vendor/ and generated paths. No service providers, no config publishing, no bootstrapping.
Technical risk: Low-to-moderate. The dominant risk is the standard "new sniff = new failures" pattern: v2.5.0 adds a sniff enforcing typehint rules on the first parameter of filter callbacks. Existing green pipelines can go red on upgrade with zero application changes. Secondary risk is that a narrow, single-purpose sniff shipped in a .0 release may have incomplete edge-case coverage.
Release verdict (v2.5.0): Additive, no breaking changes, no deprecations. Low urgency — fold into normal dependency cadence rather than an emergency bump.
Key questions:
add_filter/apply_filters call-graph analysis, or naming heuristics?Stack fit: Composer dev dependency; runs as vendor/bin/phpcs in CI alongside PHPStan/Psalm. There is meaningful overlap with Pint/PHP-CS-Fixer — scope each tool to distinct rule sets explicitly, or the two will disagree and generate noise.
Migration path: Adopt opt-in-by-directory. Create a scoped ruleset (e.g. phpcs-wp.xml) covering only WordPress integration paths, run it report-only and non-blocking, triage violation counts, then promote to blocking. Avoid big-bang adoption.
Compatibility: Confirm the PHPCS major version constraint against whatever version the repo already pins for other standards — mismatched PHPCS majors are the most common failure mode here. Confirm the PHP floor against the oldest runtime you support.
Sequencing for the v2.5.0 bump:
phpcs -s to get sniff codes; isolate violations attributable specifically to the new typehint rule.--fix and diff-review — do not auto-merge.Maintenance: Near-zero runtime maintenance; the real cost is ruleset curation. Someone must own phpcs.xml.dist and severity decisions, or the standard gets disabled wholesale the first time it blocks a release.
Support: Single-vendor OSS project with a small maintainer pool, no SLA and no LTS. Bus factor is the genuine risk — mitigate by pinning to a known-good minor and retaining the option to fork or drop the standard if it goes stale.
Scaling: Technically trivial (static analysis, parallelizes per CI job). The scaling limit is human: violation backlogs grow faster than team size, and legacy WordPress code accumulates findings quickly. Budget remediation capacity proportional to the surface you put under the ruleset.
Failure modes:
phpcs:ignore and never revisit.--fix output touching filter callbacks.Ramp-up: Roughly an hour for a developer to install and run; about a day to internalize sniff codes and the suppression workflow. The new typehint rule needs a short written rationale (WordPress filter callbacks receive mixed and nullable values, so constraining the first parameter is unsafe) — without it, engineers will reasonably push back and ignore the finding.
How can I help you explore Laravel packages today?