interaction-design-foundation/coding-standard
A shared PHP coding standard from Interaction Design Foundation for Laravel/PHP projects. It packages PHP_CodeSniffer rules so teams can enforce consistent style and catch common issues with minimal configuration, standardizing local and CI checks across apps and packages.
Architecture fit: Still a development-time tooling package with zero application runtime coupling, but 1.0.0 changes what is being adopted. It is now a three-tool toolchain with an explicit division of roles: PHP-CS-Fixer as the primary formatter (PER-CS 3.0, shipped as a config factory Config::create(__DIR__)), PHP_CodeSniffer 4 as a supplementary structural/semantic layer, and Rector as a new transformation step. That is a materially larger architectural commitment than the 0.x "rulesets plus config" package. The package also now imposes a platform constraint — PHP ^8.4 — which makes it a driver of the organization's runtime upgrade roadmap rather than a passive consumer of it.
Integration feasibility: Feasibility drops from "high on paper" to "conditional." Three gates now sit in front of adoption:
The 0.x → 1.0 upgrade is a documented, mechanical but large diff (run composer cs, review and commit). Documentation improved — custom sniffs are now documented in one place (including the previously undocumented Functions.MissingOptionalArgument) and there is a copyable auto-fix CI workflow — which materially reduces the support and reverse-engineering burden flagged previously.
Technical risk: Runtime blast radius remains low; change risk is now moderate-to-high for a tooling package:
@PHP8x4Migration:risky and @PHPUnit10x0Migration:risky are enabled, so upgrades can produce behavior-adjacent rewrites, not just whitespace.php_unit_method_casing enforces snake_case test method names with the PSR1 CamelCaps sniff excluded for tests/. This will rename tests at scale and can break naming-based test selection, CI filters, or reporting dashboards. It is cosmetic in code but disruptive in tooling that keys off method names.composer rector). The release explicitly delegates assertEquals → assertSame to AssertEqualsToSameRector because it only rewrites provably-scalar assertions — a good decision, and evidence the maintainers are thinking about false-positive rewrites. But it also confirms Rector can make semantic edits, so it must be scoped and reviewed, not lumped into "style."stefanzweifel/git-auto-commit-action v7. That introduces a bot that writes to branches — a policy, branch-protection, and review question that did not exist in the prior assessment.Key questions:
pint.json configs?@PHP8x4Migration:risky and @PHPUnit10x0Migration:risky presets individually toggleable, so teams can stage risky rules behind formatting rules?ordered_class_elements member ordering?Stack fit: Good fit for Laravel repos on Composer and modern CI (GitHub Actions, GitLab CI), conditional on PHP 8.4. Install as require-dev; production images stay untouched. The critical framing for stakeholders: this is not a lint config, it is a standardized toolchain plus a style source of truth. Pint should be treated as superseded where this package is adopted, and pint.json files should be retired deliberately rather than left to drift.
Migration path: Two tracks, run in parallel.
Config::create(__DIR__), keep <rule ref="IxDFCodingStandard"/> in phpcs.xml, and delete formatting sniff overrides that no longer exist. Run composer cs in dry-run to size the diff.The 1.0 diff is large and mechanical. Land it as isolated commits split by category — formatting (PHP-CS-Fixer), test method renames, Rector transformations — so reviewers can skim mechanical changes and scrutinize semantic ones. Add .git-blame-ignore-revs so attribution survives. Do not let Rector rewrites share a commit with formatting.
Compatibility: Pin PHP-CS-Fixer, PHP_CodeSniffer 4, Rector, and the package version together, and validate against the organization's supported PHP/Laravel matrix — the matrix and the toolchain are now coupled at the 8.4 boundary. Confirm PHPCS 4 does not conflict with any remaining first-party sniffs. Verify CI runtime for all three tools before making the gate blocking; measure full-repo vs changed-file.
Sequencing:
pint.json, one source of truth)..git-blame-ignore-revs.Maintenance: Higher than 0.x, and the profile changed. The organization now maintains three tool versions (PHP-CS-Fixer, PHPCS 4, Rector) plus the standard itself. Rector is the biggest new maintenance burden: it has a fast release cadence and its rules change behavior, so each bump deserves a dry-run and a diff review, not a blind patch bump. Assign an owner for pinning, upstream review, and rule-change announcements. Adoption remains low, so retain the fork/vendor contingency — 1.0 is a healthy signal, not a guarantee of upstream longevity.
Support: Two distinct audiences. Engineers fluent in PHP-CS-Fixer/PHPCS ramp fast; teams that only knew Pint need guidance on the new split of responsibilities ("PHPCS alone is no longer a complete standard — run composer cs"). The now-documented custom sniffs, the consolidated docs, and the copyable CI workflow meaningfully lower support load. Expect a spike in questions during the first upgrade, driven mostly by the snake_case test rename and the risky-preset fixes. Internal docs should cover install, the three commands, auto-fix usage, the Rector review policy, and the exception process.
Scaling: Config sharing still scales well across repos, and the single consolidated workflow replaces the previous two style workflows — a net simplification in CI surface. The cost shifts to execution time: three tools across the repo is more expensive than one, and Rector is the slowest. Use changed-file scanning, parallel execution, and caching; avoid full-repo blocking runs on large legacy codebases until baselines exist. The auto-commit action is a scaling risk at high PR volume — many bot commits across many repos will consume CI minutes and reviewer attention, so scope it tightly.
Failure modes:
Ramp-up: Longer than the prior estimate. Budget two to four sprints per team once PHP 8.4 is in place, front-loaded by the size of the mechanical diff and the test rename — plus a separate, org-wide platform track for the 8.4 upgrade. Treat these as distinct line items in planning. TPM success metrics: PHP 8.4 readiness across target repos, CI duration delta per repo, volume and size of the one-time auto-fix PRs, style-related review comments post-adoption, exception count (especially for test naming and member ordering), bot-commit review rate, and repository adoption rate against the 8.4-ready denominator.
How can I help you explore Laravel packages today?