1// short example of what DIC does
2class Foo
3{
4 public function __construct(Bar $bar)
5 {
6 }
7}
8
9$foo = $container->get('Foo');
10// Which is equivalent to the following
11$bar = new Bar;
12$foo = new Foo($bar);
13
1class Foo
2{
3 public function __construct(Bar $bar)
4 {
5 }
6}
7
8$foo = $container->get('Foo');
9// qui est équivalent à ce qui suit
10$bar = new Bar;
11$foo = new Foo($bar);
12