- How do I integrate phpquality-bundle into a Laravel project?
- Install via Composer with `composer require amoifr/phpquality-bundle`, register the bundle in `config/bundles.php`, and run `php bin/console phpquality:analyze --source=src/` for analysis. For Docker, pull `amoifr13/phpquality` and mount your project directory.
- Does phpquality-bundle support Laravel’s layered architecture (Domain, Application, etc.)?
- Yes, use the `--type=laravel` flag to align analysis with Laravel’s conventions. It automatically excludes framework-specific patterns like Eloquent, Facades, and Service Providers from layer violation checks.
- Will phpquality-bundle break my CI pipeline if I run it immediately?
- No, use `--generate-baseline=phpquality.baseline.json` first to create a snapshot of your current code. Then apply the baseline with `--baseline=...` to avoid failing builds on day one.
- Can I customize which SOLID violations are flagged for Laravel?
- Absolutely. Edit `phpquality.json` to override layer definitions, whitelist violations (e.g., Facade usage), or adjust DIP rules. The Laravel preset already excludes common framework patterns, but you can fine-tune further.
- What Laravel versions and PHP versions does phpquality-bundle support?
- The bundle requires **PHP 8.3+** and works with Laravel 10+ (Symfony 6+ compatible). It’s designed for modern Laravel stacks but may need adjustments for older versions due to dependency requirements.
- How does phpquality-bundle compare to PHPStan or Psalm for Laravel?
- Unlike PHPStan (type-checking) or Psalm (static analysis), phpquality-bundle focuses on **architecture, complexity, and maintainability metrics**. Use it alongside these tools—it’s not a replacement but complements them with high-level insights.
- Will running phpquality-bundle slow down my CI pipeline?
- Yes, full reports (HTML, Git blame) can add latency. Mitigate this by using `--no-html` for CLI-only output or `--json` for API-friendly results. For large codebases, consider running it on a schedule, not per-commit.
- Can I use phpquality-bundle without Docker?
- Yes, the Symfony Bundle is the primary method. Install via Composer and run `php bin/console phpquality:analyze`. Docker is optional but useful for isolated analysis or CI environments.
- How do I handle false positives for Laravel-specific code (e.g., Facades, Eloquent)?
- The Laravel preset already excludes most framework patterns. For edge cases, use `phpquality.json` to whitelist directories (e.g., `app/Providers`) or specific classes. Test with `--generate-baseline` first to identify issues.
- Is phpquality-bundle actively maintained? What if I need help?
- The package is maintained by Pascal CESCON, but activity is limited (3 GitHub stars, no dependents). Check the [GitHub Issues](https://github.com/amoifr/phpquality/issues) for open questions. For critical issues, consider forking or contributing.