Conditions | 2 |
Paths | 2 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
25 | 5 | public function __call($method, $params) |
|
26 | { |
||
27 | 5 | $pipeline = new Pipeline(app()); |
|
28 | |||
29 | 5 | if (!is_string($this->callable)) { |
|
30 | $core = (function ($params) use ($method) { |
||
31 | 1 | return $this->$method(...$params); |
|
32 | 3 | })->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 | 5 | ->via('handle') |
|
41 | 5 | ->send($params) |
|
42 | 5 | ->through($this->middlewares) |
|
43 | 5 | ->then($core); |
|
44 | } |
||
45 | } |
||
46 |