1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Ray\Di; |
||
6 | |||
7 | /** |
||
8 | * Builds the graphs of objects that make up your application |
||
9 | * |
||
10 | * The injector tracks the dependencies for each type and uses bindings to inject them. |
||
11 | * This is the core of Ray.Di, although you rarely interact with it directly. |
||
12 | * This "behind-the-scenes" operation is what distinguishes dependency injection from its cousin, the service locator pattern. |
||
13 | */ |
||
14 | interface InjectorInterface |
||
15 | { |
||
16 | /** |
||
17 | * Return object graph |
||
18 | * |
||
19 | * @param ''|class-string<T> $interface |
||
0 ignored issues
–
show
Documentation
Bug
introduced
by
![]() |
|||
20 | * @param string $name |
||
21 | * |
||
22 | * @return ($interface is '' ? mixed : T) |
||
0 ignored issues
–
show
|
|||
23 | * |
||
24 | * @template T of object |
||
25 | */ |
||
26 | public function getInstance($interface, $name = Name::ANY); |
||
27 | } |
||
28 |