container-interop/service-provider
Experimental PSR draft to standardize PHP service providers (“bundles/modules”) for PSR-11 containers. Defines interfaces for registering factories and extensions so modules can share container definitions across frameworks. Not stable before 1.0; expect breaking changes.
Illuminate\Contracts\Container\Container), so this update future-proofs integration.ContainerInterop\ServiceProvider contract, so existing Laravel service providers remain unaffected.get() vs. PSR-20’s has()/get()).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| PSR-20 Adoption Gaps | Low | Laravel 10+ already supports PSR-20 natively. |
| Third-Party Lag | Medium | Monitor for packages still on PSR-11. |
| Experimental Status | High | Unchanged; still evaluate stability. |
| Performance | Low | PSR-20 adds negligible overhead. |
phpstan/extension-installer to validate PSR-20 compliance.Illuminate\Contracts\Container\Container may expose additional methods.container-interop/polyfill).laminas/laminas-diactoros.php-di/php-di).composer.json to allow PSR-Container ^2.0:
"require": {
"psr/container": "^2.0"
}
psr/container:^1.1 in third-party packages with ^2.0 where possible.has() instead of get() checks).ContainerInterop\Container, update to the latest version (likely PSR-20 compliant).composer require container-interop/polyfill
| Component | Compatibility Status | Notes |
|---|---|---|
| Laravel 10+ | High (native PSR-20) | No changes needed. |
| Laravel 9.x | Medium (may need polyfill) | Test with container-interop/polyfill. |
| Custom Service Providers | High (PSR-20 backward-compatible) | No code changes required. |
| Third-Party Packages | Variable (check PSR/Container version) | Prefer PSR-20-compliant packages. |
| PHPUnit Tests | High (PSR-20 is superset of PSR-11) | Update assertions if needed. |
composer.json to allow PSR-Container ^2.0.psr/container:1.1 with ^2.0 in dependencies.ContainerInterop\Container to the latest version (if used).container extension to enforce PSR-20 compliance.rules:
ContainerInterface:
psr-20: true
NotFoundException).psr/container to ^1.1 if a critical package fails (but this is unlikely).composer require laravel/bench
vendor/bin/bench run
| Scenario | Impact | Mitigation |
|---|---|---|
| PSR-20 package conflicts | Low (rare) | Downgrade psr/container to ^1.1. |
| Laravel <10 PSR-20 gaps | Medium | Use container-interop/polyfill. |
| Third-party PSR-11-only packages | Low | Isolate or update dependencies. |
| CI/CD validation failures | Low | Update PHPStan/Psalm rules. |
composer.json and CI.has()How can I help you explore Laravel packages today?