wyrihaximus/phpstan-rules-wrapper
Composer wrapper that bundles popular PHPStan rule sets and extensions into one install. Works out of the box with phpstan/extension-installer, pulling in strict, deprecation, PHPUnit, Mockery, dead-code detection, PSR-3, and type-coverage rules.
phpstan/extension-installer, it integrates seamlessly with existing PHPStan configurations, avoiding conflicts with Laravel’s autoloading or service container.composer require wyrihaximus/phpstan-rules-wrapper) and minimal PHPStan config updates (e.g., adding includes or level directives). No Laravel-specific setup is needed.ergebnis/noPhpstanIgnore) are disabled by default due to known conflicts. Teams must review the disabled rules list to avoid false positives/negatives.symplify/phpstan-extensions, tomasvotruba/type-coverage) align with our team’s coding standards?no-hardcoded-config)?^) cause compatibility issues?phpstan/extension-installer or phpstan/phpstan) will benefit from the wrapper’s pre-configured rule sets.# GitHub Actions example
- name: Run PHPStan with wrapper
run: vendor/bin/phpstan analyse --level=max app/
phpstan.neon) for conflicts with bundled rules.composer require --dev wyrihaximus/phpstan-rules-wrapper
phpstan.neon to include the wrapper’s rules:
includes:
- vendor/wyrihaximus/phpstan-rules-wrapper/rules.neon
level or paths as needed.phpstan/laravel (for Doctrine/Eloquent).phpstan.neon:
disableRules:
- 'Shipmonk\DeadCodeDetector\DeadCodeDetectorRule'
--error-format=github for actionable feedback.phpstan --memory-limit=1G and adjust CI timeouts.composer require phpstan/phpstan-strict-rules).--generate-baseline) helps scale to large codebases.CONTRIBUTING.md or a wiki.--level=5 (recommended) and adjust based on team feedback.phpstan --cache-results).| Failure Mode | Impact | Mitigation |
|---|---|---|
| Rule conflicts with Laravel | False positives/negatives | Disable conflicting rules (e.g., ergebnis/noPhpstanIgnore). |
| PHPStan version incompatibility | Analysis breaks | Pin PHPStan version in composer.json or fork the wrapper. |
| Performance degradation | CI timeouts | Optimize phpstan.neon (e.g |
How can I help you explore Laravel packages today?