| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 24 | 3 | public function make($command) |
|
| 25 | { |
||
| 26 | 3 | if (!class_exists($command)) { |
|
| 27 | 1 | throw CommandException::notFound($command); |
|
| 28 | } |
||
| 29 | |||
| 30 | 2 | $command = $this->injector->make($command); |
|
| 31 | |||
| 32 | 2 | if (!($command instanceof CommandInterface)) { |
|
| 33 | 1 | throw CommandException::invalidCommand($command); |
|
| 34 | } |
||
| 35 | |||
| 36 | 1 | return $command; |
|
| 37 | } |
||
| 38 | } |
||
| 39 |