- Does this package add Laravel-specific linting (e.g., Blade, Eloquent, or route validation)?
- No, this package enforces generic PHP conventions (PSR-12, naming rules) and has no Laravel-specific checks. For Laravel codebases, tools like Laravel Pint or PHPStan’s Laravel extension are better suited.
- How do I integrate this into a Laravel project’s CI pipeline?
- Add it as a pre-commit hook or CI step using `vendor/bin/grumphp run`. However, since it lacks Laravel-specific rules, prioritize Laravel Pint or PHPStan for Laravel code validation to avoid false positives.
- Will this package break Laravel’s dynamic properties (e.g., `$fillable`, `__get()`)?
- Yes, it may flag Laravel-specific patterns as violations. You’ll need to manually exclude them in your `grumphp.yml` or `phpcs.xml.dist` to prevent false positives.
- Is this package compatible with Laravel 10 and PHP 8.2+?
- No, the package relies on outdated dependencies (e.g., PHP-CS-Fixer v3.x) and hasn’t been updated since 2022. Use it at your own risk, or consider forking and maintaining it.
- Can I customize the PHPStan or PHP-CS-Fixer rules for Laravel?
- The package provides default configurations, but Laravel-specific overrides (e.g., allowing `protected $guarded`) require manual edits. No built-in Laravel rule sets are included.
- What’s the performance impact of running this in CI compared to Laravel Pint?
- This package runs multiple tools (PHPStan, Psalm, PHP-CS-Fixer) sequentially, which may slow down CI. Laravel Pint is optimized for Laravel and runs faster for most Laravel-specific checks.
- Does this package support Blade template linting?
- Yes, it includes Twig CS (for Blade files), but no Laravel-specific Blade validation. For deeper Blade checks, consider integrating Laravel Pint or custom PHPStan rules.
- How do I exclude Laravel’s magic methods (e.g., `__get()`, `__set()`) from linting?
- Edit your `phpcs.xml.dist` to exclude Laravel-specific patterns. Example: `<exclude-pattern>.*__get.*</exclude-pattern>`. No built-in Laravel exclusions exist.
- Is there a maintained alternative for Laravel-specific conventions?
- Yes, use Laravel Pint (official) or PHPStan’s Laravel extension for Laravel-specific linting. This package is generic and hasn’t been updated for Laravel’s evolving patterns.
- Can I run this package manually without Git hooks?
- Yes, execute `vendor/bin/grumphp run` in your terminal. However, for Laravel projects, manual runs of Laravel Pint or PHPStan are more efficient.