batteryincluded/batteryincluded-bundle
batteryincluded-bundle appears to be a Symfony/Laravel bundle designed to enforce PSR-12 coding standards and PHPStan rules, aligning with modern PHP best practices. This fits well in projects requiring strict code quality gates (e.g., enterprise applications, open-source contributions, or CI/CD pipelines).symfony/flex or manual integration. Feasibility depends on:
ConfigurableInterface) that Laravel lacks.Extension system.config/ structure may need adaptation (e.g., via mergeConfigFrom).composer.json constraints.phpstan/phpstan, symfony/flex, or Laravel’s core packages (e.g., illuminate/support).parameters.ruleSets.ContainerBuilder or DependencyInjection in ways incompatible with Laravel’s ServiceProvider?BootstrapServiceProvider for early static analysis)?phpstan.neon and .php-cs-fixer.dist.php for overlaps/conflicts.composer require batteryincluded/batteryincluded-bundle
config/app.php (if not auto-discovered).config/bundles.php (Symfony-style) or Laravel’s config/ for rule sets.- name: Run Battery Included Bundle
run: vendor/bin/batteryincluded check
Illuminate\Support\Facades\*).vendor/ and bootstrap/ from analysis (common in PHPStan).phpstan.neon by merging configurations.includes:
- vendor/batteryincluded/batteryincluded-bundle/neon/rules.neon
- phpstan.neon
| Step | Priority | Effort | Risk |
|---|---|---|---|
| Validate bundle in test project | High | Low | Low |
| Configure PSR-12 rules | Medium | Low | Low |
| Integrate PHPStan rules | High | Medium | Medium |
| CI/CD pipeline setup | Medium | Low | Low |
| Full strict mode enforcement | Low | High | High |
--parallel flag for large codebases.| Failure Mode | Impact | Mitigation |
|---|---|---|
| Bundle abandonment | Broken rules, unpatched issues | Fork or maintain locally |
| Overly strict rules | Developer frustration | Customize rulesets incrementally |
| CI/CD pipeline failures | Blocked merges | Gradual enforcement, whitelists |
| PHPStan version conflicts | Rule incompatibilities | Pin versions in composer.json |
How can I help you explore Laravel packages today?