Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
32 | 17 | protected function getApiInstance($method): object |
|
33 | { |
||
34 | 17 | $class = "\\SchoppAx\\Sleeper\\Api\\".ucwords($method); |
|
35 | |||
36 | 17 | if (class_exists($class)) { |
|
37 | 16 | return new $class($this->client); |
|
38 | } |
||
39 | 1 | throw new \BadMethodCallException("Undefined method [{$method}] called."); |
|
40 | } |
||
43 |