Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
20 | 4 | protected function create(ContainerInterface $container, $config) |
|
21 | { |
||
22 | 4 | $transport = $container->get($config['transport']); |
|
23 | |||
24 | 4 | if (!$transport instanceof Transport) { |
|
25 | 1 | throw $this->getException('transport', Transport::class, ServiceNotCreatedException::class, $transport); |
|
26 | } |
||
27 | 3 | $endpoint = $container->get($config['endpoint']); |
|
28 | |||
29 | 3 | if (!is_callable($endpoint)) { |
|
30 | 1 | throw $this->getException('endpoint', 'callable', ServiceNotCreatedException::class, $endpoint); |
|
31 | } |
||
32 | 2 | return new Client($transport, $endpoint); |
|
33 | } |
||
34 | |||
43 |