Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Container Wrapper Bundle

Container Wrapper Bundle Laravel Package

liip/container-wrapper-bundle

Symfony bundle that provides a lightweight wrapper around the service container, letting you inject a container interface into services and fetch dependencies lazily without coupling code to Symfony's full container.

View on GitHub
Deep Wiki
Context7

[DEPRECATED] Don't screw DI by just injecting everything.

Frequently asked questions about Container Wrapper Bundle
Does liip/container-wrapper-bundle work with Laravel?
No. liip/container-wrapper-bundle is a Symfony bundle that integrates through FrameworkBundle, the kernel, a DI extension, and the compiler-pass pipeline — extension points Laravel does not have. It ships no Laravel service provider, facade, auto-discovery, or config surface. Laravel developers should use contextual binding, interface-to-closure bindings, or a small custom accessor interface instead.
What is liip/container-wrapper-bundle used for?
It provides a lightweight, PSR-11 compliant wrapper around the Symfony service container so a service can lazily fetch only whitelisted service IDs instead of receiving the whole container. The goal is explicit dependencies and no leakage of framework internals into reusable code. It does not add features to Laravel and is not a Laravel package.
How do I install liip/container-wrapper-bundle?
Install it with Composer in a Symfony application: composer require liip/container-wrapper-bundle, then register LiipContainerWrapperBundle in your bundles.php or kernel. Configuration is zero-config by default, with an optional whitelist for allowed service IDs. It cannot be installed as a Laravel package because there is no Laravel integration to register.
Is liip/container-wrapper-bundle PSR-11 compliant?
Yes. The wrapper implements Psr\Container\ContainerInterface and resolves services lazily through get() and has(). A configurable whitelist restricts which service IDs may be resolved, so consumers get a narrow slice rather than the full container. That makes it usable with any PSR-11-aware consumer inside a Symfony app.
Which Laravel version does liip/container-wrapper-bundle support?
None. No Laravel version is supported because the package is not a Laravel package at all. The 1.1.0 tag does not add a service provider, auto-discovery, or compatibility work. In Laravel, the same pattern is a short interface plus contextual bindings you own.
What are the Laravel alternatives to liip/container-wrapper-bundle?
Laravel's contextual binding, interface-to-closure bindings, and constructor injection already cover the use case natively. You can define a small accessor interface and bind a closure that resolves only the services a class needs. This is roughly 50–100 lines and one to two engineer-days, fully owned and testable. No third-party Symfony bundle is required.
Is liip/container-wrapper-bundle still maintained?
Unclear. The previous release was dated 2015-10-26, and a 1.1.0 tag now exists, but its release notes are only the string 'see #6' with no changelog, compatibility claims, or security notes. A single tag is evidence of a commit, not of active maintenance, issue triage, or security response. Treat maintenance status as unknown.
Does liip/container-wrapper-bundle support PHP 8 and Symfony 6 or later?
Unverified. The 1.1.0 release notes do not mention PHP platform constraints, a Symfony major bump, or PHP 8 support, and no composer.json diff is available. Assume PHP ~5.x and Symfony ~2.x until a composer.json proves otherwise. This compatibility gap is the gating blocker for modern use.
Can I use liip/container-wrapper-bundle in production?
Only in an existing Symfony app pinned to compatible PHP and Symfony versions, and even then the maintenance and compatibility risks are unmeasurable from the available metadata. Abandoned and lightly maintained both carry similar supply-chain remediation exposure. For a Laravel production application it is not viable, because the Symfony framework layer is required at runtime.
How do I test services that depend on the container wrapper?
Because the wrapper implements PSR-11 ContainerInterface, you can replace it with a simple test stub that returns prepared test doubles from get(). In Symfony, inject a mock ContainerInterface into the service under test; in Laravel, bind a fake accessor implementation to your interface in the container. Keep tests focused on the service's behavior, not on the container itself.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo