irstea/php-cs-fixer-shim
A compatibility shim for php-cs-fixer that provides a stable entry point for PHP coding-style checks and fixes, helping projects avoid dependency and version conflicts while keeping formatting tooling consistent.
Architecture fit. This is a developer-tooling shim, not a runtime library. It belongs in require-dev and has no bearing on Laravel's request lifecycle, service container, or Eloquent layer. Its architecture role is one of two things, and the distinction drives every downstream decision: a metapackage that simply requires friendsofphp/php-cs-fixer at a pinned version (typically to bridge a private registry or lock a version the org standardizes on), or a fork/replacement using Composer's replace/provide semantics to ship patched code. The repository name and the IRSTEA internal GitLab host suggest the former, but this must be confirmed by reading composer.json before any integration decision is made. Note the overlap risk: Laravel ships Pint, which is itself a thin opinionated wrapper around PHP-CS-Fixer. A Laravel codebase using this shim alongside Pint creates two paths to the same binary and a likely style-config collision.
Integration feasibility. Straightforward mechanically — add a vcs repository entry pointing at gitlab.irstea.fr, supply credentials via COMPOSER_AUTH or a deploy token, and composer require --dev. The friction is entirely in access and governance, not in code: private GitLab means every developer machine, CI runner, and container build needs credentialed Composer access, and that credential becomes a build-time hard dependency.
Technical risk.
laravel/pint or a direct friendsofphp/php-cs-fixer requirement can produce Composer solver failures or, worse, silently resolve to a version you did not intend.Key questions.
require/replace/provide?laravel/pint? Which is the org's intended single source of truth for style?Stack fit. Laravel 10–12 on PHP 8.1–8.4 with Composer 2. The shim slots into the dev toolchain alongside or in place of Pint, feeding .php-cs-fixer.dist.php config and typically invoked through a Composer script (composer lint, composer fix), a GitLab CI job, or a pre-commit hook (GrumPHP, CaptainHook).
Migration path.
composer.json and any README — resolve the metapackage-vs-fork question first.php-cs-fixer fix --dry-run --diff against a representative fixture set and compare output against the project's current Pint/config baseline.Compatibility. Verify the PHP constraint against your oldest supported runtime, confirm there is no duplicate friendsofphp/php-cs-fixer requirement in the root project, and check whether the shim's replace (if present) would mask a directly-required version. Audit the lockfile diff, not just the resolver's success message.
Sequencing. Resolve the access/credential story (GitLab deploy token, COMPOSER_AUTH in CI variables) before touching application repos — credential plumbing is the actual long pole. Then: sandbox validation → single-repo pilot → CI template → rollout → documentation.
Maintenance. The shim inserts a hop into the upgrade chain: PHP-CS-Fixer release → shim bump → consuming repos. Each hop is a manual act by a team that may not prioritize it. Pin exact versions, set a quarterly review against upstream releases, and write down explicit exit criteria — "if the shim lags upstream by more than two minor versions, we drop it and require friendsofphp/php-cs-fixer directly." Given zero external dependents, there is no community pressure to keep it current.
Support. Internal-only. No Stack Overflow surface, no upstream maintainer to escalate to. Onboarding requires an internal README covering what the shim is, why it exists, and how to debug a failed install. The credential rotation runbook matters as much as the tool documentation.
Scaling. Compute cost is negligible — it is a dev dependency that never runs in production. The scaling problem is configuration fan-out: N repositories each need the VCS repo entry and working credentials. Centralize with a Satis/Private Packagist mirror or a shared config.json/base CI image so credentials and repository definitions live in one place. Full-repo fixer runs on large monorepos can consume meaningful CI minutes; scope to changed files where possible.
Failure modes.
composer install in every pipeline fails simultaneously. Highest-severity, most likely failure.git blame and create merge conflicts across open branches.Ramp-up. Low. A mid-level developer is productive in under an hour; the tool follows standard PHP-CS-Fixer conventions and configuration. The genuine cost is governance and credential management, not learning curve — which is precisely why this should be treated as internal infrastructure with a named owner rather than adopted as a dependency with implicit trust.
How can I help you explore Laravel packages today?