| 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 | 118 | public function _call($method, $param) |
|
| 12 | { |
||
| 13 | 118 | $method = $this->aliases[$method] ?? $method; |
|
| 14 | |||
| 15 | 118 | if (! isset($this->methods[$method])) { |
|
| 16 | throw new \BadMethodCallException($method.' does not exist'); |
||
| 17 | } |
||
| 18 | |||
| 19 | 118 | $condition = $this->methods[$method]; |
|
| 20 | |||
| 21 | 118 | if (is_callable($condition)) { |
|
| 22 | 1 | return call_user_func_array($condition, $param); |
|
| 23 | } |
||
| 24 | |||
| 25 | 117 | [$class, $method] = explode('@', $condition); |
|
| 26 | |||
| 27 | 117 | return call_user_func_array([new $class, $method], $param); |
|
| 28 | } |
||
| 50 |