| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 1 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function create(array $service) |
||
| 16 | { |
||
| 17 | // var_dump($service['foo']);exit; |
||
| 18 | // $name = 'foo'; |
||
| 19 | // if (!isset($service[$name]) || empty($service[$name])) { |
||
| 20 | // throw new ContainerException( |
||
| 21 | // 'Service should be an array with key value pair: ' . $name |
||
| 22 | // ); |
||
| 23 | // } |
||
| 24 | // |
||
| 25 | // if (!class_exists($service[$name]['class'])) { |
||
| 26 | // throw new ContainerException( |
||
| 27 | // 'Class does not exists: ' . $service[$name]['class'] |
||
| 28 | // ); |
||
| 29 | // } |
||
| 30 | // |
||
| 31 | // $class = new \ReflectionClass($service[$name]['class']); |
||
| 32 | // return $class->newInstance(); |
||
| 33 | } |
||
| 34 | } |
||
| 35 |