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