Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
23 | 30 | public function __call(string $methodName, $arguments): Condition |
|
24 | { |
||
25 | 30 | $method = '_' . $methodName; |
|
26 | |||
27 | 30 | if(method_exists($this, $method)) |
|
28 | { |
||
29 | 28 | if(array_key_exists(0, $arguments)) |
|
30 | { |
||
31 | 27 | return $this->$method($arguments[0]); |
|
32 | } |
||
33 | |||
34 | 1 | throw new \RuntimeException(sprintf("Missing parameter 1 for %s", $method)); |
|
35 | } |
||
36 | |||
37 | 2 | throw new \LogicException(sprintf("Unkown method %s", $method)); |
|
38 | } |
||
39 | } |
||
40 |