- What is ergebnis/php-cs-fixer-config used for?
- It provides a configuration factory and ready-made rule set factories for friendsofphp/php-cs-fixer. In a Laravel project, you use it as a dev dependency to apply consistent PHP coding standards across application and package code. It is not a runtime package and does not change how Laravel serves requests.
- How do I install ergebnis/php-cs-fixer-config in a Laravel project?
- Run composer require --dev ergebnis/php-cs-fixer-config in your Laravel project. Then create a .php-cs-fixer configuration that uses the package's configuration factory and a rule set class such as Php83. Commit the config so every developer and CI job uses the same standards.
- Which PHP versions and Laravel versions are supported?
- The package ships rule sets for PHP 5.3 through 8.3, so you can match the rule set to the PHP version your Laravel app targets. It is a PHP-level tool rather than a Laravel package, and the release assessment notes backward compatibility with Laravel 10 and 11. Check your app's PHP constraint before choosing a rule set.
- How do I choose a rule set for my Laravel project?
- Pick the rule set that matches the minimum PHP version your Laravel project must support, for example Php82 for a PHP 8.2 codebase. Higher rule sets can use newer syntax-aware fixes, so do not select a rule set above your deployment target. Start with a dry run to see the diff before applying fixes.
- Can I customize or override the PHP-CS-Fixer rules?
- Yes. The package exposes rule set factories and a configuration factory, so you can build on the provided rules and override individual fixers in your own configuration. Keep overrides small and documented, because broad custom rules can conflict with future PHP-CS-Fixer changes. Run php-cs-fixer fix --dry-run --diff after changes to verify behavior.
- Does this package work with Laravel Pint or should I use Pint instead?
- Pint is a lighter option if you want a Laravel-first formatter with minimal setup and do not need Rector integration. This package is a better fit when you want explicit PHP-CS-Fixer rule sets, PHP-version-aware configuration, and a shared standard across Laravel and non-Laravel PHP code. You can use either, but avoid running both formatters on the same files without agreeing on one source of truth.
- How do I run PHP-CS-Fixer with this config in CI?
- Install the package as a dev dependency and run vendor/bin/php-cs-fixer fix --dry-run --diff in CI to fail on style drift. In a typical Laravel pipeline, cache Composer dependencies and run the check after composer install. Keep the PHP-CS-Fixer version pinned to a known-good minor range so patch updates do not surprise the build.
- Will upgrading ergebnis/php-cs-fixer-config break my Laravel project?
- The assessed 6.64.1 release is a maintenance release with patch-level dependency bumps and no consumer-facing API changes. The assessment confirms backward compatibility with Laravel 10 and 11 and no new rule behavior. Still run a dry check after upgrading and pin PHP-CS-Fixer and Rector to predictable minor ranges.
- Does it integrate with Rector for Laravel upgrades?
- It can coexist with Rector, and the assessment notes that Rector plus PHP-CS-Fixer guidance remains valid for Laravel migration work. The package itself does not add Laravel refactoring rules; if your project already uses Rector and ergebnis/rector-rules, keep them pinned and verify interactions. Run vendor/bin/rector process --dry-run before applying both tools in one pass.
- Is ergebnis/php-cs-fixer-config actively maintained and safe for production?
- Yes, it is actively maintained and the assessed release is a low-risk maintenance update. Because it is installed with --dev, it does not ship to production runtime. Pin versions, keep it out of production installs with composer install --no-dev, and refresh it during routine dependency windows.