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