jrmajor/cs
jrmajor/cs is an opinionated coding standard package for PHP projects, bundling PHP-CS-Fixer rules and presets so you can enforce consistent code style across your codebase with minimal configuration and a single install.
This is a small, single-maintainer coding-standard package (2 stars, no dependents), so the first job is to find out exactly what it wraps before you wire it into anything.
composer.json on the repo and check the require / require-dev block. That tells you whether it is a PHP CS Fixer config, a Laravel Pint preset, a PHP_CodeSniffer ruleset, or an ECS config — the day-to-day commands differ completely between those. Then read src/ (usually a handful of files: a Config class or a rules.php / .php-cs-fixer.dist.php you are meant to require).composer require --dev jrmajor/cs:^1.0
With zero dependents and a personal-project release cadence, an unpinned ^ on a 0.x tag will eventually break CI on a Tuesday.app/ and tests/ on the same commit:
vendor/bin/php-cs-fixer fix app --dry-run --diff --using-cache=no
# or
vendor/bin/pint --test app
Read the diff. Ten minutes here tells you more about the package's opinions than any README.Composer scripts as the single entry point. Give the team two verbs and make everything else call them:
"scripts": {
"cs": "php-cs-fixer fix --dry-run --diff",
"cs:fix": "php-cs-fixer fix"
}
Then CI, pre-commit hooks, and humans all invoke composer cs, so switching the underlying tool later is a one-line change.
CI as an enforcement gate, not a fixer. In GitHub Actions, run the dry-run variant on the changed paths and fail the job on a non-zero exit. Keep caching on (.php-cs-fixer.cache keyed on the PHP version + lockfile hash) or the job gets slow enough that people start skipping it.
Publish/extend rather than fork. If the package ships a config you require, create your own .php-cs-fixer.dist.php that imports theirs and then merges project-specific rules on top. Rules are applied in order and later entries win, so your overrides must come after the require. This is the intended extension point and it survives package upgrades far better than copying their rules file into your repo.
Tiered strictness by path. One ruleset for app/, a looser one for tests/ and database/migrations/, and no fixing at all under vendor/, storage/, bootstrap/cache/, and generated files. Most config formats let you declare multiple finder blocks with different rule sets.
Layer it with static analysis, not instead of it. CS tools only touch whitespace, imports, and syntax shape. Pair with PHPStan/Larastan and (optionally) Rector. Order in CI: cs → phpstan → tests, cheapest first so formatting nits fail fast.
Pre-commit hook for the files that changed. A lint-staged-style invocation (php-cs-fixer fix --path-mode=intersection <staged files>) keeps commits clean without a repo-wide pass. GrumPHP or CaptainHook are the usual Laravel-side wrappers.
Editor alignment. Install the PHP CS Fixer (or Pint) extension in PhpStorm/VS Code, point it at your project config, enable format-on-save. If you skip this, developers will hand-format to their own habits and the CI job becomes a nag rather than a tool.
composer.json; do not guess from the package name.--dry-run --diff across the whole repo, and read the changelog. composer update in a lockfile-refresh PR is how surprise reformats land..php-cs-fixer.cache is keyed on file hashes and the ruleset; stale caches after a config change produce "no changes" lies. Add --using-cache=no when debugging, and gitignore the cache (or commit it deliberately — just pick one, don't let it flip-flop).--config pointing elsewhere is a classic source of "it fixed nothing" confusion.|| true to "make CI green," and don't run the fixing variant in CI (it will pass while leaving the working tree dirty and silently discarded).--dev install, and exclude the binary from any deploy artifact. It has no runtime role.requires theirs and appends rules; (2) a custom fixer class registered with the tool for project-specific patterns (e.g. house-style docblocks); (3) a fork — last resort, and only if the maintainer is unresponsive, since you inherit maintenance permanently.How can I help you explore Laravel packages today?