Total Complexity | 6 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | final class RoutableMessageBusFactory |
||
15 | { |
||
16 | /** @var string */ |
||
17 | private $fallbackBusName; |
||
18 | |||
19 | 2 | public function __construct(string $fallbackBusName = 'messenger.bus.default') |
|
22 | 2 | } |
|
23 | |||
24 | 2 | public function __invoke(ContainerInterface $container): MessageBusInterface |
|
25 | { |
||
26 | /** @var null|MessageBusInterface $fallbackBus */ |
||
27 | 2 | $fallbackBus = $container->has($this->fallbackBusName) ? $container->get($this->fallbackBusName) : null; |
|
28 | |||
29 | 2 | return new RoutableMessageBus($container, $fallbackBus); |
|
30 | } |
||
31 | |||
32 | /** |
||
33 | * @param string $name |
||
34 | * @param array $arguments |
||
35 | * |
||
36 | * @return MessageBusInterface |
||
37 | */ |
||
38 | 3 | public static function __callStatic(string $name, array $arguments): MessageBusInterface |
|
48 | } |
||
49 | } |
||
50 |