pekral/phpcs-rules
pekral/phpcs-rules provides custom PHP_CodeSniffer rules and coding-standard configuration for PHP projects, helping teams enforce consistent style, catch common issues, and integrate automated checks into development and CI workflows.
What this package is: pekral/phpcs-rules is a PHP_CodeSniffer standards ruleset (dev-tooling only). It does not ship runtime code, so integration risk is confined to developer machines and CI pipelines rather than production services.
Architecture fit: Good, with a caveat. A PHPCS ruleset is a low-coupling dependency — consumed as a require-dev package and referenced via phpcs.xml <rule ref="..."/>. It has no runtime surface, no service boundary, no data contracts. The only architectural coupling is the transitive constraint it places on the PHP version of the environments that run static analysis.
The material change in 0.5: composer.json now requires php: ^8.5. This is not a stylistic break — it makes the package uninstallable on PHP 8.4 and below. Composer will refuse to resolve, which means the upgrade is not "optional churn"; it is a hard gate on the toolchain PHP version, independent of what the application actually runs on.
Technical risk (ranked):
SlevomatCodingStandard.Functions.StaticClosure and excluding Classes.ReadonlyClass changes lint output. Under semver this is correctly a minor, but for a lint ruleset a minor bump can turn green builds red. Consumers should expect new violations without a code change on their side.^8.5 pinning suggests opinionated release cadence. Not a blocker, but it argues for pinning exact versions rather than ranges.Key questions to resolve before committing:
0.4.x, and for how long?StaticClosure / ReadonlyClass ruleset changes produce against our codebase?Stack fit: Compatible in shape — any Laravel/PHP repo already running PHPCS can consume it. What changed is the environment requirement, not the integration mechanism. Fit is therefore conditional on PHP 8.5 being runnable in the lint lane.
Recommended posture: defer adoption, pin deliberately.
0.4.* (exact-ish constraint, e.g. ~0.4.8) with a comment in composer.json recording the PHP 8.5 gate and the review date.0.5.x as a tracked upgrade ticket with an explicit trigger condition (PHP 8.5 GA + CI image availability), not a routine bump.Migration path (when the trigger fires):
0.4.x → 0.5.x and run the full ruleset against the codebase. Capture the violation diff attributable to StaticClosure and ReadonlyClass. Decide per-repo whether to fix, baseline, or exclude.composer.json change and the resulting code fixes must be one reviewable unit.phpcs.xml template, then the rest.Compatibility notes:
Sequencing summary: verify 8.5 availability → decouple lint runtime → measure violation delta → adopt in one repo → template → fleet → drop 0.4.x. Nothing in that chain is urgent, and the cost of waiting is low. The cost of being early is a broken CI across every repo at once.
Maintenance: Low ongoing effort, but with a new pinning obligation. Someone must own the "PHP 8.5 readiness" ticket and the review date, otherwise the package silently freezes at 0.4.8 while the rest of the toolchain moves. Add a calendar reminder / backlog item with an owner.
Support: Upstream support for 0.4.x is the open question. The changelog's own guidance ("Projects still on PHP 8.4 should stay on the 0.4.x line") implies the branch is expected to persist, but the removal of 8.4 from CI means it is no longer tested — support is nominal, not active. Plan on no upstream fixes for 8.4; if we hit a bug, we patch or exclude the sniff ourselves.
Scaling: Trivially scalable. A ruleset has no runtime footprint, no throughput characteristics, and no per-request cost. The only scaling dimension is repo count, and the lever there is the shared phpcs.xml template — centralise the rule set and version pin so N repos don't drift into N configurations.
Failure modes and mitigations:
| Failure mode | Impact | Mitigation |
|---|---|---|
| Composer resolution fails on PHP 8.4 after a bot bump | CI blocked, noisy revert | Exclude 0.5.x from automated updates; pin ~0.4.8 |
New StaticClosure violations flood builds |
Red CI, developer friction | Measure delta first; baseline or fix in the same PR as the bump |
| Split rulesets across repos (0.4.x and 0.5.x coexisting) | Inconsistent lint results, "works in repo A not B" | Roll out via shared template; track adoption per repo |
| PHP 8.5 image unavailable or unstable | Cannot adopt at all | Containerise lint independently of app runtime; defer until GA + stable images |
| Upstream 0.4.x abandoned mid-migration | Stuck on an unpatched tool | Timebox the migration; accept local fork/patch as fallback |
^8.5 constraint surprises a developer's local PHP |
Local composer install fails |
Document required PHP version in README/onboarding; devcontainer |
Ramp-up: Minimal. No new concepts for anyone who already runs PHPCS — it's a constraint bump and one or two rule toggles. Expect ~half a day for a developer to run the delta and triage findings, plus remediation time proportional to the StaticClosure hit count. The genuinely new knowledge is operational, not technical: the team needs to understand why lint runs on a different PHP version than the app, or someone will "helpfully" align them and break the pipeline later.
Bottom line for the TPM: This is a small, contained, dev-tooling change that is currently not adoptable pending PHP 8.5 GA. The correct action today is to pin, exclude from automation, assign an owner, and schedule re-evaluation — not to migrate. The package remains a safe dependency at 0.4.8; the risk is entirely in an unmanaged or automated upgrade.
How can I help you explore Laravel packages today?