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 package for friendsofphp/php-cs-fixer configs. Provides ready-made rule sets per PHP version (5.3–8.5) and helpers to build a consistent, reusable fixer configuration for your projects.

View on GitHub
Deep Wiki
Context7

ergebnis/php-cs-fixer-config is a Composer dev package that provides a reusable configuration factory and versioned rule set factories for friendsofphp/php-cs-fixer. It helps standardize code style across projects while keeping rules aligned with your target PHP version (from 5.3 up to 8.5).

Choose the appropriate Ergebnis\PhpCsFixer\RuleSet\PhpXX and build a consistent .php-cs-fixer.php setup with minimal boilerplate and predictable formatting.

  • Prebuilt rule sets for PHP 5.3–8.5
  • Factory-based configuration to reduce duplication
  • Version-aware defaults matching language features
  • Easy to integrate via Composer as a dev dependency
  • Designed for consistent, shareable coding standards across repos
Frequently asked questions about Php Cs Fixer Config
How do I install this package for my Laravel project?
Run `composer require --dev ergebnis/php-cs-fixer-config` in your Laravel project directory. This adds the package as a dev dependency, making it available for development workflows like CI checks or local fixes.
Which PHP version rule set should I use for Laravel 10.x?
For Laravel 10.x, which requires PHP 8.1+, use the `Php81`, `Php82`, or `Php83` rule sets. These align with modern PHP features and Laravel’s latest requirements. Check your Laravel version’s PHP support docs for exact alignment.
Can I customize the default rules for Laravel-specific patterns like Facades or Blade templates?
Yes, you can override rules using the factory’s `withRules()` method. For example, add `'no_unused_imports' => true` to handle Laravel Facades or exclude Blade files by configuring the `finder` in your `.php-cs-fixer.php` file.
Will this package conflict with Laravel Pint or other code style tools?
This package replaces Laravel Pint by providing a broader PHP-CS-Fixer configuration. If you’re using Pint, you’ll need to choose one tool to avoid conflicts. PHP-CS-Fixer offers more granular control but requires manual setup for Laravel-specific rules.
How do I integrate this into GitHub Actions for Laravel?
Add a step to your workflow file like this: `- name: Run PHP-CS-Fixer uses: ergebnis/php-cs-fixer-config/actions/run-fixer`. Alternatively, use a custom script to run `php-cs-fixer fix --config=.php-cs-fixer.php` in your CI pipeline.
Does this package support Blade template files (.blade.php)?
By default, no. Blade files are often excluded from PHP-CS-Fixer rules. Use the `finder` configuration in `.php-cs-fixer.php` to exclude them or apply custom rules via third-party fixers like `spatie/php-cs-fixer-custom-fixers`.
How do I test performance impact in CI for large Laravel codebases?
Run `php-cs-fixer fix --dry-run --stats` in your CI to measure execution time and memory usage. Monitor the cache directory (`.build/php-cs-fixer`) for performance bottlenecks, especially if your project has thousands of files.
Can I use this with Laravel Forge or Envoyer for deployment?
Yes, include the `.php-cs-fixer.php` config file in your repository and ensure it’s deployed to staging/production servers. Use Forge’s deployment scripts or Envoyer’s configuration to run checks during deployment if needed.
What happens if I upgrade PHP-CS-Fixer to a newer version?
This package abstracts most configuration, but you may need to update your rule set (e.g., `Php81` to `Php82`) if PHP-CS-Fixer introduces breaking changes. Always check the [PHP-CS-Fixer changelog](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/main/CHANGELOG.md) for compatibility.
How do I exclude specific directories (e.g., vendor/) from PHP-CS-Fixer?
Configure the `finder` in your `.php-cs-fixer.php` file to exclude directories. For example, add `'exclude' => ['vendor/', 'node_modules/']` to the `finder` array to skip third-party code and build artifacts.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport