1 | <?php |
||
12 | trait ContainerTrait |
||
13 | { |
||
14 | protected $parameters = []; |
||
15 | protected $services = []; |
||
16 | |||
17 | 4 | public function __construct(array $parameters = []) |
|
21 | |||
22 | /** |
||
23 | * @param string $key |
||
24 | * @param mixed $value |
||
25 | */ |
||
26 | 1 | public function setParameter($key, $value) |
|
30 | |||
31 | /** |
||
32 | * @param string $key |
||
33 | * @param mixed $default |
||
34 | * @return mixed |
||
35 | */ |
||
36 | 1 | public function getParameter($key, $default = null) |
|
44 | |||
45 | /** |
||
46 | * @param string $name |
||
47 | * @param object $service |
||
48 | * @return mixed |
||
49 | * @throws ServiceMustBeAnObjectException |
||
50 | */ |
||
51 | 3 | public function setService($name, $service) |
|
59 | |||
60 | /** |
||
61 | * @param string $name |
||
62 | * @return mixed |
||
63 | * @throws ServiceMustBeAnObjectException |
||
64 | * @throws ServiceNotFoundException |
||
65 | */ |
||
66 | 3 | public function getService($name) |
|
80 | } |
||
81 |