Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function __invoke(ContainerInterface $container): TransportFactoryInterface |
||
20 | { |
||
21 | if (! class_exists(DoctrineTransportFactory::class)) { |
||
22 | return new UnsupportedTransportFactory(); |
||
23 | } |
||
24 | |||
25 | /** @var array{connection_registry?: string|null, manager_registry: string} $config */ |
||
26 | $config = $container->get('config')[ConfigProvider::CONFIG_KEY]['doctrine'] ?? []; |
||
27 | /** @var ConnectionRegistry $connectionRegistry */ |
||
28 | $connectionRegistry = $container->get($config['connection_registry'] ?? $config['manager_registry']); |
||
29 | |||
30 | return new DoctrineTransportFactory($connectionRegistry); |
||
31 | } |
||
33 |