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

prooph/php-cs-fixer-config

Shared PHP-CS-Fixer configuration from the prooph team. Provides a ready-to-use ruleset and presets to keep PHP code style consistent across projects, with an easy way to apply and maintain formatting standards in CI or local development.

View on GitHub
Deep Wiki
Context7

PHP CS Fixer config for prooph components

Frequently asked questions about Php Cs Fixer Config
How do I install this PHP-CS-Fixer config for Laravel projects?
Run `composer require --dev prooph/php-cs-fixer-config` and add it to your project’s `.php-cs-fixer.php` config file. The package provides a ready-to-use ruleset that integrates seamlessly with Laravel’s existing toolchain.
Does this config work with Laravel’s default PSR-12 rules?
No, this config prioritizes prooph’s DDD/CQRS conventions (e.g., event naming, event store patterns) over PSR-12. You’ll need to merge configs or override conflicting rules like `array_syntax` or `class_attributes` to avoid clashes.
Can I use this in CI/CD pipelines like GitHub Actions?
Yes. Add a step to run `php-cs-fixer fix --config=.php-cs-fixer.php --dry-run` in your workflow. Cache the `.php-cs-fixer.cache` file to speed up execution, especially for large codebases.
What Laravel versions does this package support?
This package has no direct Laravel dependency but requires PHP 8.0+. It’s compatible with Laravel 9+ (PHP 8.0+) and works alongside Laravel’s default tooling like Valet, Sail, or Pint with minor adjustments.
How do I handle prooph-specific patterns that conflict with PHP-CS-Fixer?
Document exceptions in your team’s style guide. For example, prooph’s event sourcing annotations (e.g., `@Event`) may trigger false positives. Override rules in your `.php-cs-fixer.php` or use `ignore` patterns for known cases.
Should I enforce this config in pre-commit hooks?
Yes, but start gradually. Use it as a pre-commit hook (e.g., with Husky) to catch style issues early, but avoid blocking merges initially. Enforce it strictly in CI/CD pipelines first to minimize disruption.
What if prooph updates their config and breaks my project?
Pin to a specific version (e.g., `^1.0`) or fork the package if needed. Monitor prooph’s releases for rule changes and test updates in a staging environment before adopting them globally.
Does this config support Laravel Mix or Pint?
Yes, but you may need to exclude prooph-specific rules that conflict with Laravel’s defaults. For Pint, extend its config with prooph’s ruleset. For Mix, use a custom Webpack plugin or run PHP-CS-Fixer separately.
How do I customize the header template for prooph’s copyright notice?
Create a `.docheader` file in your project root with the provided template. The config will automatically inject it into your PHP files. You can modify the template to match your project’s licensing requirements.
Are there alternatives to this config for Laravel projects?
Yes, but most alternatives (e.g., `laravel/php-cs-fixer`) focus on PSR-12. For DDD/CQRS projects, this config is tailored to prooph’s conventions, including event naming, aggregate roots, and event store patterns. Consider merging it with Laravel’s defaults if needed.
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