jubeki/laravel-code-style
Opinionated code style configuration for Laravel projects. jubeki/laravel-code-style provides a ready-to-use Pint preset to enforce consistent formatting and coding conventions across your app, helping teams keep clean, predictable PHP code with minimal setup.
Architecture fit. jubeki/laravel-code-style is a developer-tooling Composer package, not a runtime dependency. It layers custom PHP-CS-Fixer fixers on top of Laravel Pint's ruleset, so it slots into the existing Laravel code-style pipeline without altering application architecture. It is additive: Pint remains the engine and preset, the package contributes the fixers and wiring that Pint does not ship natively. This is the safest possible category of dependency — dev-only, invoked from Composer scripts or vendor/bin, with no production surface area, no service provider at runtime, and no data migration. It is appropriate for teams that have already standardized on Pint and have a specific, identified gap that Pint's opinionated preset does not cover.
Integration feasibility. Low-complexity. Integration is a composer require --dev, a config file in the repo root, and a command invocation. The real feasibility question is not mechanical but scoping: does the team actually need custom fixers, or does Pint's stock preset already suffice? If the latter, this package adds config surface and maintenance coupling for no gain. The package is also plausibly useful for package authors who want the Laravel ruleset applied inside their own src/ without depending on the full application scaffold.
Technical risk. Contained but non-zero, concentrated in version coupling rather than runtime behavior.
Key questions. TPM due diligence before adoption:
laravel preset does not already enforce, and what is the cost of those rules being applied inconsistently?composer.json?Stack fit. Strong for Laravel applications and first-party Laravel packages on PHP 8.x with Composer. It assumes Pint is already part of the toolchain; teams on PHP_CodeSniffer or PHP-CS-Fixer directly, without Pint, get no benefit and should not adopt it. It is a poor fit for non-Laravel PHP projects, for teams that deliberately want a non-opinionated or PSR-12-only ruleset, and for environments that disallow dev dependencies on low-provenance packages.
Migration path. Treat this as an additive, reversible layer, never as a replacement for Pint.
--test passes on the pinned Pint version). If it is not, run Pint and land that as a standalone commit so the package's effect can be isolated later.require-dev with an exact or caret-pinned constraint; commit the lockfile. Add its config alongside the existing pint.json rather than modifying the Pint preset.Compatibility. Constrain Pint, PHP-CS-Fixer, and this package together and upgrade them as a unit, not independently. Confirm support for every PHP version in the matrix before rollout, and verify that custom fixers are exercised in CI on each supported PHP version rather than only the newest. Watch for the package lagging behind the current Pint release — if it does, pin Pint lower until the wrapper catches up.
Sequencing. (1) Confirm the rules gap and get stakeholder agreement that consistency matters. (2) Pilot in one high-traffic repo with a small, well-defined set of custom fixers. (3) Validate determinism by running twice and confirming the second run is a no-op. (4) Enforce in CI and add a pre-commit hook if the team uses them. (5) Baseline remediation of existing violations as a separate, isolated commit. (6) Expand to additional repos only after a full Pint upgrade cycle has passed without friction.
Maintenance. The ongoing cost is version-tracking, not bug-fixing. Every Pint or PHP-CS-Fixer release is a potential compatibility event; budget a small recurring review at each upgrade. Custom fixers written in-house carry their own maintenance burden — that cost exists regardless of this package and should not be attributed to it. The dependency itself is small and stable in scope, so the marginal maintenance load is low as long as the pinned versions do not drift.
Support. The primary support risk is bus factor. A 55-star community package with an unverified repository is maintained on best-effort terms: no SLA, no guaranteed compatibility window, and a plausible path to abandonment. Mitigations are straightforward and should be non-optional: pin versions and lockfiles, vendor or mirror the package internally if policy requires it, and keep a documented fallback (drop the dependency, inline the handful of fixers as project-local PHP-CS-Fixer configuration). The MIT license makes forking viable, which is a meaningful contingency. Do not adopt this in a context that requires vendor support contracts.
Scaling. Scales well across repositories because it inherits Pint's execution model — per-file, parallelizable, cacheable. The constraint is CI wall-clock time, not dependency complexity; add it to an existing Pint step rather than a separate job, and use fixer caching if available. Cost grows with code volume and number of custom fixers, both linear and modest. Organizational scaling (many repos, many teams) is a config-distribution problem, best solved by a shared preset rather than per-repo drift.
Failure modes. Enumerate and pre-assign responses:
Ramp-up. Low for anyone already using Pint — the mental model is unchanged, and the new surface is one config file plus one command invocation, so a working engineer is productive in under an hour. Authoring new custom fixers is a different skill tier and requires PHP-CS-Fixer familiarity; plan for one or two engineers to own that rather than distributing it across the team. Documentation burden is a short README section on why each custom rule exists — worth writing, because otherwise the next maintainer removes rules they cannot justify, and formatting drifts back to Pint defaults. Budget one senior engineer for a day to pilot and write the internal guidance, then treat it as background maintenance thereafter.
How can I help you explore Laravel packages today?