| Conditions | 4 |
| Paths | 4 |
| Total Lines | 23 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 4.0582 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 9 | public function process(ContainerBuilder $container) |
|
| 23 | { |
||
| 24 | 9 | $dsn = Dsn::parse($container->getParameter('bdf_queue.failer_dsn')); |
|
| 25 | 9 | $scheme = $dsn->getScheme(); |
|
| 26 | 9 | $availableScheme = []; |
|
| 27 | |||
| 28 | 9 | foreach ($container->findTaggedServiceIds(self::CONFIGURATOR_TAG_NAME) as $serviceId => $tag) { |
|
| 29 | /** @var FailerDriverConfiguratorInterface $configurator */ |
||
| 30 | 9 | $configurator = $container->get($serviceId); |
|
| 31 | |||
| 32 | 9 | if (!$configurator->available($container)) { |
|
| 33 | continue; |
||
| 34 | } |
||
| 35 | |||
| 36 | 9 | $availableScheme[] = $configurator->scheme(); |
|
| 37 | 9 | if ($scheme === $configurator->scheme()) { |
|
| 38 | 9 | $container->setAlias(FailedJobRepositoryInterface::class, $configurator->configure($dsn, $container)); |
|
| 39 | |||
| 40 | 7 | return; |
|
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | throw new \InvalidArgumentException('Unsupported failer DSN scheme '.$scheme.'. Available : '.implode(', ', $availableScheme)); |
||
| 45 | } |
||
| 47 |