~20 lines). No API changes, middleware, or service provider hooks are needed.friendsofphp/php-cs-fixer), which must be installed separately. Version conflicts could arise if multiple CS tools are used.php-cs-fixer.dist.php)..php-cs-fixer.php).Alignment with Existing Standards:
use App\Models\... vs. Laravel’s use Illuminate\Support\....Maintenance Strategy:
Toolchain Impact:
phpstan, pint) in use? How will this package integrate with them?.php-cs-fixer.dist.php configurations?Adoption Incentives:
CI/CD Integration:
laravel-shift/php-cs-fixer) are used.pint or custom CS rules, this package could override or conflict with them..php-cs-fixer.php and merge rules explicitly.vendor/bin/php-cs-fixer fix --dry-run to identify style violations.--allow-risky=yes cautiously to avoid false failures.simple-php-unit).app/ directory structure).^3.0 (latest stable) is used to avoid rule incompatibilities.composer why-not to check for version constraints.composer require --dev friendsofphp/php-cs-fixer..php-cs-fixer.php with Eloquent’s preset.vendor/, storage/) if needed..github/workflows/php.yml or Laravel’s phpunit.xml:
- name: PHP-CS-Fixer
run: vendor/bin/php-cs-fixer fix --dry-run --diff --rules=@Eloquent
CONTRIBUTING.md.fix.sh script to auto-format code:
#!/bin/bash
vendor/bin/php-cs-fixer fix
.php-cs-fixer.php or use @phpcs:disable annotations.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| PHP-CS-Fixer version conflict | Build failures | Pin version in composer.json (^3.0). |
| Eloquent style conflicts with team | Developer pushback | Customize rules or switch to another preset. |
| Package abandonment | Broken rules in future PHP-CS-Fixer | Fork and maintain internally. |
| Overly strict rules | Block merges for legitimate code | Exclude paths or override rules. |
| CI flakiness | False negatives/positives | Test with a sample repo before full rollout. |
How can I help you explore Laravel packages today?