| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 20 | public function build($name, $args = []) |
||
| 21 | { |
||
| 22 | $className = $this->namespace.$name.'\\'.$name; |
||
| 23 | if ( ! class_exists($className)) { |
||
| 24 | throw new \Exception('Class: '.$className.' not found.'); |
||
| 25 | } |
||
| 26 | $container = new \ReflectionClass($className); |
||
| 27 | $container = $container->newInstanceArgs($args); |
||
| 28 | if ( ! $container instanceof ContainerInterface) { |
||
| 29 | throw new \Exception('Bad container implementation'); |
||
| 30 | } |
||
| 31 | return $container; |
||
| 32 | } |
||
| 33 | } |
||
| 34 |