sunrise/coding-standard
Sunrise PHP Coding Standard provides a ready-to-use PHPCS ruleset (ruleset.xml) you can reference in your project to enforce consistent code style across src and tests, aligned with PSR-1 and PSR-2.
friendsofphp/php-cs-fixer) via custom ruleset composition..php-cs-fixer.dist.php or phpcs.xml.App\Services\*), Blade indentation, or Eloquent method chaining?phpcs.xml configuration (same as above).php-cs-fixer fix --rules=./vendor/sunrise/coding-standard/ruleset.xml).laravel-pint or custom scripts).vendor/bin/php-cs-fixer fix).- name: Sunrise Coding Standard
run: vendor/bin/php-cs-fixer fix --rules=./vendor/sunrise/coding-standard/ruleset.xml --dry-run
--allow-risky=yes cautiously for PHP 8.x compatibility.ruleset.xml to include/exclude specific files (e.g., ignore resources/views if Blade rules are missing)..php-cs-fixer.dist.php to include Sunrise rules).| Tool/Framework | Compatibility | Notes |
|---|---|---|
| PHP 7.4–8.2 | ⚠️ Partial | Untested on PHP 8.x; may need fixes. |
| Laravel 8–10 | ⚠️ Partial | No native support; manual config req’d. |
| PHP-CS-Fixer | ✅ Full | Standard ruleset integration. |
| PHP_CodeSniffer | ✅ Full | XML ruleset support. |
| Pint (Laravel) | ❌ No | Pint uses PHP-CS-Fixer; ruleset must be added separately. |
feature/x).composer update (though risky due to staleness).1.0.0 in composer.json to avoid accidental updates.sunrise-php/coding-standard-laravel) or alternatives.| Scenario | Impact | Mitigation |
|---|---|---|
| Rules break PHP 8.x code | CI failures, dev frustration | Pin to PHP 7.4, or fork + fix. |
| Laravel-specific rules missing | Inconsistent codebase | Customize ruleset or switch tools. |
| No updates for years | Security/bug risk | Monitor forks or alternatives. |
| Overlaps with Pint | Redundant tooling | Consolidate into one ruleset. |
How can I help you explore Laravel packages today?