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

m6web/php-cs-fixer-config

Reusable PHP CS Fixer configuration from M6Web/Bedrock Streaming. Install via Composer and use the provided BedrockStreaming config in .php-cs-fixer.dist.php, with options to extend/override rules for your project or CI.

View on GitHub
Deep Wiki
Context7
Frequently asked questions about Php Cs Fixer Config
How do I install this PHP-CS-Fixer config for my Laravel project?
Run `composer require --dev m6web/php-cs-fixer-config` in your Laravel project’s root. Then create a `.php-cs-fixer.dist.php` file and extend the `BedrockStreaming` config class. The package provides a starter template in its README.
Does this config work with Laravel 10 and PHP 8.4?
Yes, this config is fully compatible with Laravel 10 and PHP 8.4. It includes rules like `native_function_invocation` and `declare_strict_types` that align with modern PHP features. Ensure your `composer.json` supports PHP 8.4.
Can I customize the rules for my Laravel project?
Absolutely. Extend the `BedrockStreaming` config class in your `.php-cs-fixer.dist.php` file and override or add rules. The README provides examples for inheritance-based customization, including enabling risky rules if needed.
Will this break my existing Laravel 8 or PHP 7.4 codebase?
This config drops PHP 7.4 support and may enforce strict rules like `declare_strict_types`. Use `--dry-run` to preview changes before enforcing them. For legacy code, override rules in your config or whitelist exceptions.
How do I integrate this into GitHub Actions for CI?
Add a GitHub Actions workflow step to run `make cs-ci` (or directly call `php-cs-fixer fix --dry-run`). The package includes a Makefile template for CI/CD. You can gate merges by setting `if: always()` in your workflow.
Does this config include Laravel-specific rules like ordered imports or facade imports?
No, this config focuses on PSR-12 standards. For Laravel-specific rules (e.g., `ordered_imports`, `no_unused_imports`), you’ll need to manually extend the config or consider alternatives like `laravel-pint`.
How do I avoid false positives in my CI pipeline?
Use `--using-cache=yes` to speed up CI runs and reduce false positives. For specific issues, override rules in your `.php-cs-fixer.dist.php` file. The `--dry-run` flag helps preview changes before enforcement.
Can I use this with pre-commit hooks like Husky?
Yes, integrate it with Husky by adding a pre-commit script to run `make cs` (check) or `make cs-fix` (auto-fix). The package’s Makefile includes targets for local and CI use, making it easy to adapt.
What’s the difference between this and Laravel Pint?
This package uses PHP-CS-Fixer with a reusable config, while Pint is a Laravel-specific wrapper for PHP-CS-Fixer. Pint may offer tighter Laravel integration (e.g., facade imports), but this config gives you more control over PSR-12 rules.
How do I lock the PHP-CS-Fixer version to avoid breaking changes?
Pin the PHP-CS-Fixer version in your `composer.json` (e.g., `^3.57` or `~3.57.0`). The package’s config is designed for PHP-CS-Fixer v3.57+, so locking the version ensures stability. Check the package’s `composer.json` for compatibility.
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.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor