Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3.0123 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | 112 | public function _call($method, $param) |
|
12 | { |
||
13 | 112 | $method = $this->aliases[$method] ?? $method; |
|
14 | |||
15 | 112 | if (! isset($this->methods[$method])) { |
|
16 | throw new \BadMethodCallException($method.' does not exist'); |
||
17 | } |
||
18 | |||
19 | 112 | $condition = $this->methods[$method]; |
|
20 | |||
21 | 112 | if (is_callable($condition)) { |
|
22 | 1 | return call_user_func_array($condition, $param); |
|
23 | } |
||
24 | |||
25 | 111 | [$class, $method] = explode('@', $condition); |
|
26 | |||
27 | 111 | return call_user_func_array([new $class, $method], $param); |
|
28 | } |
||
50 |