| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | 4 | public function getHandlerForCommand($commandName) |
|
| 43 | { |
||
| 44 | 4 | $callable = $this->callable; |
|
| 45 | 4 | $handler = $callable($commandName); |
|
| 46 | |||
| 47 | // Odds are the callable threw an exception but it always pays to check |
||
| 48 | 3 | if ($handler === null) { |
|
| 49 | 1 | throw MissingHandlerException::forCommand($commandName); |
|
| 50 | } |
||
| 51 | |||
| 52 | 2 | return $handler; |
|
| 53 | } |
||
| 54 | } |
||
| 55 |