| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 3 | public function get($id): callable |
|
| 27 | { |
||
| 28 | 3 | if (false === $this->has($id)) { |
|
| 29 | 1 | throw ActionNotFoundException::withId($id); |
|
| 30 | } |
||
| 31 | |||
| 32 | try { |
||
| 33 | 2 | $action = $this->actions[$id](); |
|
| 34 | 1 | } catch (Throwable $exception) { |
|
| 35 | 1 | throw ActionContainerException::withIdAndPreviousException($id, $exception); |
|
| 36 | } |
||
| 37 | |||
| 38 | 1 | return $action; |
|
| 39 | } |
||
| 46 |