bytic / container
Php Container module for bytic framework
Requires
- php: ^8.1
- bytic/utility: ^1.0
- psr/container: ^1.1|^2.0
- ramsey/collection: ^1.2|^2.0
- symfony/config: ^5.3|^6.0|^7.0|^8.0
- symfony/dependency-injection: ^5.3|^6.0|^7.0|^8.0
Requires (Dev)
- bytic/config: ^0.9|^1.0|^2.0
- mockery/mockery: ^1.6
- phpunit/phpunit: ^10.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-22 19:01:29 UTC
README
Symfony integration
The package supports PHP 8.1+ and Symfony DependencyInjection 5.3 through 8.x.
Symfony 8 requires PHP 8.4 or newer. Existing new Container(), service
providers, aliases and reflection-based resolution continue to work.
For new services, configure a Symfony ContainerBuilder directly and pass it
to the compatibility container:
use Nip\Container\Container; use Symfony\Component\DependencyInjection\ContainerBuilder; $builder = new ContainerBuilder(); $builder->register(MyService::class)->setAutowired(true)->setPublic(true); $container = new Container($builder); // Configure and compile the builder with Symfony's normal APIs when needed. $builder->compile(); $service = $container->get(MyService::class);
getSymfonyContainer() exposes the underlying Symfony container;
setSymfonyContainer() remains available for existing integrations. A
Symfony container can also be supplied to the constructor. Symfony definitions,
aliases and compiler passes should be configured on a ContainerBuilder before
compilation. Symfony's normal visibility and compiled-container restrictions
apply. The legacy providers, reflection fallback and value wrapping belong to
the compatibility container and are not available through the Symfony
container directly.