Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
30 | 4 | public static function createClient(string $type, array $credentials) |
|
31 | { |
||
32 | switch ($type) { |
||
33 | 4 | case 'soap': // fall through |
|
34 | 2 | case 'soap_doclit': |
|
35 | 3 | $builder = SoapClientBuilder::create('soap'); |
|
36 | 3 | break; |
|
37 | |||
38 | default: |
||
39 | 1 | throw new \InvalidArgumentException('Unsupported client type'); |
|
40 | } |
||
41 | |||
42 | return $builder |
||
43 | 3 | ->setAuthentication($credentials) |
|
44 | 2 | ->setServiceEndpoint(static::ENDPOINTS[$type]) |
|
45 | 2 | ->build(); |
|
46 | } |
||
48 |