phpstan/extension-installer
Composer plugin that automatically discovers and installs PHPStan extensions, eliminating manual includes in phpstan.neon. Add it as a dev dependency, allow the plugin in Composer, and extensions can declare includes via extra.phpstan for auto-setup.
Architecture fit: The package is a Composer plugin designed for dev dependencies, fitting seamlessly into Laravel's dependency management workflow. It operates at build time without runtime impact, leveraging Composer's event system to modify configuration during installation. This aligns perfectly with Laravel's standard development practices where static analysis tools are managed via Composer.
Integration feasibility: High. Requires only composer require --dev phpstan/extension-installer with no application code changes. Extensions automatically configure themselves via composer.json metadata, eliminating manual phpstan.neon edits. Compatible with standard Laravel project structure and Composer workflows.
Technical risk: Low. Minimal dependencies, active maintenance (latest release 2024-09-04), and no production impact if issues occur. Primary friction point is Composer's allow-plugins requirement (introduced in Composer 2.2.0), but this is well-documented and easily resolved.
Key questions: How does the plugin handle duplicate includes from multiple extensions? Are there known conflicts with other Composer plugins (e.g., security scanners)? What is the explicit compatibility matrix for Composer v1 vs v2? How does it interact with Laravel's vendor directory when committed to version control?
Stack fit: Ideal for Laravel projects using Composer for dependency management. Purely a development-time tool with no runtime dependencies or runtime performance impact. Works within standard Laravel CI/CD pipelines without modification.
Migration path: Add plugin as dev dependency → Remove manual includes entries from phpstan.neon → Reinstall existing PHPStan extensions to trigger automatic configuration. Existing manual includes must be purged to prevent duplication conflicts.
Compatibility: Supports PHP 8.0+ (required by Laravel 9+), Composer v2 (Laravel 9+ default), and PHPStan v2. Explicitly tested with Composer 2.5.6+ in latest releases.
How can I help you explore Laravel packages today?