| 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 | 8 | public function set($key, $value = null) |
|
| 25 | |||
| 26 | /** |
||
| 27 | * @param $key |
||
| 28 | * @return mixed |
||
| 29 | * @throws LookupException |
||
| 30 | */ |
||
| 31 | 8 | public function get($key) |
|
| 39 | |||
| 40 | /** |
||
| 41 | * @param $key |
||
| 42 | * @return bool |
||
| 43 | */ |
||
| 44 | 8 | public function has($key) |
|
| 48 | } |
||
| 49 |