| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 2.003 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | 4 | public function __call($method, $params) |
|
| 26 | { |
||
| 27 | 4 | $pipeline = new Pipeline(app()); |
|
| 28 | |||
| 29 | 4 | if (!is_string($this->callable)) { |
|
| 30 | $core = (function ($params) use ($method) { |
||
| 31 | return $this->$method(...$params); |
||
| 32 | 2 | })->bindTo($this->callable, $this->callable); |
|
| 33 | } else { |
||
| 34 | $core = function ($params) use ($method) { |
||
| 35 | 1 | return call_user_func_array([$this->callable, $method], $params); |
|
| 36 | 2 | }; |
|
| 37 | } |
||
| 38 | |||
| 39 | return $pipeline |
||
| 40 | 4 | ->via('handle') |
|
| 41 | 4 | ->send($params) |
|
| 42 | 4 | ->through($this->middlewares) |
|
| 43 | 4 | ->then($core); |
|
| 44 | } |
||
| 45 | } |
||
| 46 |