1 | <?php declare(strict_types = 1); |
||
16 | final class ServiceDecorator implements ServiceDecoratorContract |
||
17 | { |
||
18 | /** |
||
19 | * @var ContainerContract |
||
20 | */ |
||
21 | private $container; |
||
22 | |||
23 | /** |
||
24 | * Array of decorator definitions. |
||
25 | * |
||
26 | * @var Invokable[][]|string[][] |
||
27 | */ |
||
28 | private $decorators = []; |
||
29 | |||
30 | /** |
||
31 | * @var ServiceInflectorContract |
||
32 | */ |
||
33 | private $inflector; |
||
34 | |||
35 | /** |
||
36 | * @var InvokerContract |
||
37 | */ |
||
38 | private $invoker; |
||
39 | |||
40 | /** |
||
41 | * ServiceDecorator constructor. |
||
42 | * |
||
43 | * @param ContainerContract $container |
||
44 | * @param ServiceInflectorContract $inflector |
||
45 | * @param InvokerContract $invoker |
||
46 | */ |
||
47 | 45 | public function __construct( |
|
56 | |||
57 | /** |
||
58 | * @inheritdoc |
||
59 | */ |
||
60 | 4 | public function addDecorator(string $id, $decorator) |
|
72 | |||
73 | /** |
||
74 | * |
||
75 | * @param string $id |
||
76 | * @param $object |
||
77 | * @param bool $once |
||
78 | * @return mixed |
||
79 | */ |
||
80 | 29 | public function decorate(string $id, $object, bool $once = false) |
|
99 | } |