Search by

bytic / container

gabrielsolomon

Php Container module for bytic framework

Package info

github.com/bytic/container

Homepage

pkg:composer/bytic/container

Statistics

Installs: 15 448

Dependents: 40

Suggesters: 0

Stars: 1

Open Issues: 0

2.0.8 2026-11-22 18:57 UTC

README

Latest Version on Packagist Latest Stable Version Latest Unstable Version

Software License Build Status SensioLabsInsight Quality Score StyleCI Total Downloads

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.

Inspiration