Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Php Cs Fixer Config

Php Cs Fixer Config Laravel Package

ergebnis/php-cs-fixer-config

Factory-style PHP-CS-Fixer config for projects: choose a versioned ruleset (PHP 5.3–8.3), generate a consistent configuration, and keep coding standards aligned across repositories. Install via Composer and use with friendsofphp/php-cs-fixer.

View on GitHub
Deep Wiki
Context7

Provides a configuration factory and rule set factories for friendsofphp/php-cs-fixer.

Frequently asked questions about Php Cs Fixer Config
How do I install this package for a Laravel project?
Run `composer require --dev ergebnis/php-cs-fixer-config` in your Laravel project. The package is designed as a dev dependency and integrates seamlessly with PHP-CS-Fixer. After installation, create a `.php-cs-fixer.php` file in your project root to configure the desired rule set.
Which PHP version rule set should I use for Laravel 10 (PHP 8.2+)?
For Laravel 10, which typically uses PHP 8.2 or higher, use the `Php82` or `Php83` rule set. These configurations include rules optimized for modern PHP features like match expressions and named arguments, ensuring compatibility with Laravel’s latest syntax.
Can this package handle Blade template files in Laravel?
By default, this package focuses on PHP files. To include Blade templates (`.blade.php`), you’ll need to extend the Finder configuration in your `.php-cs-fixer.php` file. For example, add `->in([__DIR__.'/app', __DIR__.'/resources/views'])` to target Blade files explicitly.
Will this conflict with Laravel Pint or other formatters?
Yes, using both Laravel Pint and this package may cause redundancy or conflicts. If your team already uses Pint, consider migrating to this package or merging configurations. Test thoroughly in a staging environment before enforcing it in CI/CD pipelines.
How do I customize the rules for Laravel-specific needs (e.g., Eloquent queries)?
You can override or extend the default rules using the `withRules()` or `withCustomFixers()` methods in your `.php-cs-fixer.php` file. For Laravel-specific formatting, you might also explore custom fixers like `erickskrauch/php-cs-fixer-custom-fixers` and integrate them into your configuration.
Does this package support CI/CD integration for Laravel projects?
Yes, the package is CI/CD ready. You can integrate it into GitHub Actions, GitLab CI, or other pipelines by adding a step to run `composer coding-standards` or directly invoking PHP-CS-Fixer. The package includes pre-configured workflows for testing and enforcing standards in automated builds.
What Laravel versions and PHP versions does this package support?
This package supports Laravel projects running on PHP 5.3 through 8.3, with dedicated rule sets for each version. For modern Laravel applications (8.x+), use the `Php80`, `Php81`, `Php82`, or `Php83` rule sets to ensure compatibility with the latest PHP features and Laravel conventions.
How do I test this package before enforcing it in production?
Start by running `php-cs-fixer fix --dry-run` to preview changes without modifying files. Use `composer coding-standards` to test in your CI pipeline, and gradually enforce the rules by failing builds on violations. This phased approach minimizes disruption and allows for adjustments.
Can I reuse this configuration across multiple Laravel repositories?
Yes, the package is designed for reuse. By standardizing your `.php-cs-fixer.php` configuration (e.g., using the same rule set like `Php82`), you can maintain consistent code style across all Laravel projects. This is especially useful for monorepos or teams managing multiple repositories.
What are the performance implications of using this package in large Laravel projects?
PHP-CS-Fixer uses caching to improve performance, but large Laravel monorepos may experience cache invalidation challenges. To mitigate this, configure caching in `.gitignore` and consider isolating caches per project or using the `--no-cache` flag for specific runs. Monitor performance in CI/CD pipelines to optimize further.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai