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