Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | final public function resolve(string $name, string $email): array |
||
23 | { |
||
24 | $method = 'get' . ucfirst($name) . 'Variable'; |
||
25 | |||
26 | if (!method_exists($this, $method)) { |
||
27 | throw new Exception('Method ' . $method . ' should be defined.'); |
||
28 | } |
||
29 | |||
30 | return [ |
||
31 | 'name' => $name, |
||
32 | 'content' => call_user_func([$this, $method], $email) |
||
33 | ]; |
||
35 | } |