| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public static function create(IHttpClient $httpCLient, $type) |
||
| 20 | { |
||
| 21 | $className = sprintf('%s\\%sApi', __NAMESPACE__, $type); |
||
| 22 | if (class_exists($className)) { |
||
| 23 | return new $className($httpCLient); |
||
| 24 | } |
||
| 25 | |||
| 26 | throw new InvalidArgumentException("Api type `{$type}` not found."); |
||
| 27 | } |
||
| 28 | } |
||
| 29 |