| Conditions | 6 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | 47 | public static function init(string|array $optParams): ClientConfig |
|
| 30 | { |
||
| 31 | 47 | return new self( |
|
| 32 | 47 | is_array($optParams) && (isset($optParams['key'])) |
|
| 33 | 2 | ? strval($optParams['key']) |
|
| 34 | 45 | : (is_string($optParams) |
|
| 35 | 44 | ? $optParams |
|
| 36 | 47 | : throw new ServiceException('Unable to set Client credential due to your wrong params', 400) |
|
| 37 | 47 | ), |
|
| 38 | 47 | is_array($optParams) && (isset($optParams['language'])) ? strval($optParams['language']) : null, |
|
| 39 | 47 | ); |
|
| 57 |