| Total Complexity | 8 |
| Total Lines | 66 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class ContainerAdapter implements ContainerInterface |
||
| 6 | { |
||
| 7 | private $container; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * @param object $container |
||
| 11 | */ |
||
| 12 | public function __construct($container = null) |
||
| 13 | { |
||
| 14 | $this->container = $container; |
||
| 15 | } |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param object $container |
||
| 19 | */ |
||
| 20 | public function setContainer($container) |
||
| 21 | { |
||
| 22 | $this->container = $container; |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param string $id |
||
| 27 | * @return mixed |
||
| 28 | * @throws ContainerException |
||
| 29 | */ |
||
| 30 | public function get($id) |
||
| 31 | { |
||
| 32 | return $this->call('get', $id); |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @param string $id |
||
| 37 | * @return mixed |
||
| 38 | * @throws ContainerException |
||
| 39 | */ |
||
| 40 | public function has($id) |
||
| 41 | { |
||
| 42 | return $this->call('has', $id); |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @param $id |
||
| 47 | * @return mixed |
||
| 48 | * @throws ContainerException |
||
| 49 | */ |
||
| 50 | public function make($id) |
||
| 51 | { |
||
| 52 | return $this->call('make', $id); |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @param $method |
||
| 57 | * @param $id |
||
| 58 | * |
||
| 59 | * @return mixed |
||
| 60 | * @throws ContainerException |
||
| 61 | */ |
||
| 62 | protected function call($method, $id) |
||
| 71 | } |
||
| 72 | } |
||
| 73 |