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.
php: ^8.5 forces an explicit stance on "how fast do we chase the newest PHP runtime?" This is a policy question for the platform team, not a per-repo one, and it should be documented (e.g., "adopt new PHP minors within N months of GA").phpcs.xml.Consider adoption when:
slevomat/coding-standard and squizlabs/php_codesniffer themselves.0.4.x or 0.5.x) and upgrading deliberately, not continuously.Look elsewhere when:
0.4.x; do not attempt 0.5. Note that 0.5 raising minimum to 8.5 while removing the 8.4 matrix means the maintainer is no longer validating against 8.4 at all — treat the 0.4.x line as maintenance-only and plan your exit or upgrade date.0.5.0 is consistent with that, but it means you cannot rely on "minor = safe."Specific 0.5 watch-items for the adopting team:
ReadonlyClass sniff excluded — this is a loosening. If your codebase relies on that rule to enforce immutability, you now need to enforce it via review or a separate config, and existing "violations" will silently stop being flagged. Expect a one-time drop in reported issues that is not an improvement in code quality.StaticClosure re-enabled outside tests — this is a tightening. Expect a burst of new violations on first run after upgrade. Budget a cleanup pass; it's mechanical but touches many files and will conflict with in-flight branches.For executives (one paragraph): We're evaluating a small open-source package that standardizes PHP code style across our Laravel services. Its value is consistency and reduced review friction, not new product capability — it will not move roadmap metrics directly. The latest release (0.5) requires PHP 8.5, which we are not yet running, so adoption is gated on our PHP upgrade timeline; the safe action today is to stay on the 0.4.x line. The cost is low and the risk is a single-maintainer dependency, which we'd mitigate by pinning versions and keeping our config in-repo so we can swap the ruleset out if needed.
For engineering leads: Version 0.5.0 is a breaking release: minimum PHP raised to 8.5, and CI now validates only on 8.5 — the 8.4 build was removed to cut Actions spend. Concretely: (1) do not bump past 0.4.8 until the platform upgrade lands; (2) when you do bump, expect two separate one-time effects — a spike of StaticClosure violations to clean up, and a drop in ReadonlyClass findings because that sniff was dropped from the ruleset, which we'd need to backfill with review discipline or a supplementary config; (3) pin to an exact minor and treat every 0.x minor as potentially breaking. Recommendation: hold at 0.4.x, add the 0.5 upgrade to the PHP 8.5 migration ticket as a follow-on task, and do not adopt this ruleset on any repo that isn't on the same PHP floor.
How can I help you explore Laravel packages today?