1 | <?php |
||
7 | class Container |
||
8 | { |
||
9 | /** |
||
10 | * @var array |
||
11 | */ |
||
12 | private $container = []; |
||
13 | |||
14 | /** |
||
15 | * Add an object to the container |
||
16 | * |
||
17 | * @param string $key The name of a service to set in the container |
||
18 | * @param mixed $value A closure of object representing a serive |
||
19 | * @return $this |
||
20 | */ |
||
21 | 28 | public function set($key, $value = null) |
|
25 | |||
26 | 1 | public function remove($key) |
|
32 | |||
33 | /** |
||
34 | * @param $key |
||
35 | * @return mixed |
||
36 | * @throws LookupException |
||
37 | */ |
||
38 | 29 | public function get($key) |
|
46 | |||
47 | /** |
||
48 | * @param $key |
||
49 | * @return bool |
||
50 | */ |
||
51 | 29 | public function has($key) |
|
55 | } |
||
56 |