| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | 21 | public function run(Params $params = null) |
|
| 35 | { |
||
| 36 | 21 | $callable = $this->callableClass()->assemble(); |
|
| 37 | 21 | $paramsBuilderClosure = $this->callableClass()->paramsBuilderClosure(); |
|
| 38 | |||
| 39 | 21 | if (!is_callable($callable)) { |
|
| 40 | 3 | throw new NotCallable($this->rpcMethodName()); |
|
| 41 | } |
||
| 42 | |||
| 43 | 18 | if ($paramsBuilderClosure) { |
|
| 44 | 12 | return call_user_func_array($callable, $paramsBuilderClosure($params)); |
|
| 45 | } |
||
| 46 | |||
| 47 | 6 | return call_user_func($callable); |
|
| 48 | } |
||
| 49 | |||
| 58 |