Lines Matching refs:container
1 # Dependency injection container
4 container which can create services and retrieves configuration values.
47 Dependency injection container further provides a more efficient creation of
51 $container = require_once __DIR__.'/../config/container.php';
53 $data = $container->get(Repository::class)->getData();
71 Which can be retrieved by the container:
74 $value = $container->get('parameter_key');
82 // config/container.php
84 // New container initialization with configuration parameters defined in a file.
85 $container = new Container(include __DIR__.'/parameters.php');
87 // Services are then defined using callables with a container argument $c.
90 $container->set(App\Foo::class, function ($c) {
95 $container->set(App\Foo\Bar::class, function ($c) {
103 $container->set(App\Foo\Bar::class, function ($c) {
114 $container->set(App\Dependency::class, function ($c) {
118 return $container;