| Conditions | 4 |
| Paths | 8 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 10 | protected function create(ServiceLocatorInterface $serviceLocator, $config) |
|
| 21 | { |
||
| 22 | 10 | $retries = isset($config['retries']) ? $config['retries'] : 2; |
|
| 23 | 10 | $sniffOnStart = isset($config['sniff_on_start']) ? $config['sniff_on_start'] : false; |
|
| 24 | 10 | $connectionPool = $serviceLocator->get($config['connection_pool']); |
|
| 25 | |||
| 26 | 10 | if (!$connectionPool instanceof AbstractConnectionPool) { |
|
| 27 | 1 | throw $this->getException( |
|
| 28 | 1 | 'connection pool', |
|
| 29 | 1 | AbstractConnectionPool::class, |
|
| 30 | 1 | ServiceNotCreatedException::class, |
|
| 31 | $connectionPool |
||
| 32 | 1 | ); |
|
| 33 | } |
||
| 34 | 9 | $loggers = $serviceLocator->get($config['loggers']); |
|
| 35 | |||
| 36 | 9 | return new Transport($retries, $sniffOnStart, $connectionPool, $loggers['logger']); |
|
| 37 | } |
||
| 38 | |||
| 47 |