| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function __call($method, $parameters) |
||
| 35 | { |
||
| 36 | if (!method_exists($this, $method)) { |
||
| 37 | preg_match_all('/((?:^|[A-Z])[a-z]+)/', $method, $partials); |
||
| 38 | $method = array_shift($partials[0]); |
||
| 39 | if (!method_exists($this, $method)) { |
||
| 40 | throw new \Exception('Sorry! you are calling wrong method'); |
||
| 41 | } |
||
| 42 | array_unshift($parameters, strtolower(implode('_', $partials[0]))); |
||
| 43 | } |
||
| 44 | |||
| 45 | return $this->$method(...$parameters); |
||
| 46 | } |
||
| 47 | |||
| 53 |