@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | private readonly ContainerInterface $container, |
| 25 | 25 | private readonly FactoryInterface $factory, |
| 26 | 26 | private readonly ?EventDispatcherInterface $dispatcher = null |
| 27 | - ) { |
|
| 27 | + ){ |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | public function getConnection(?string $name = null): QueueInterface |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | // Replaces alias with real pipeline name |
| 34 | 34 | $name = $this->config->getAliases()[$name] ?? $name; |
| 35 | 35 | |
| 36 | - if (!isset($this->pipelines[$name])) { |
|
| 36 | + if (!isset($this->pipelines[$name])){ |
|
| 37 | 37 | $this->pipelines[$name] = $this->resolveConnection($name); |
| 38 | 38 | } |
| 39 | 39 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | { |
| 49 | 49 | $config = $this->config->getConnection($name); |
| 50 | 50 | |
| 51 | - try { |
|
| 51 | + try{ |
|
| 52 | 52 | $driver = $this->factory->make($config['driver'], $config); |
| 53 | 53 | |
| 54 | 54 | $core = new InterceptableCore( |
@@ -56,8 +56,8 @@ discard block |
||
| 56 | 56 | $this->dispatcher |
| 57 | 57 | ); |
| 58 | 58 | |
| 59 | - foreach ($this->config->getPushInterceptors() as $interceptor) { |
|
| 60 | - if (\is_string($interceptor) || $interceptor instanceof Autowire) { |
|
| 59 | + foreach ($this->config->getPushInterceptors() as $interceptor){ |
|
| 60 | + if (\is_string($interceptor) || $interceptor instanceof Autowire){ |
|
| 61 | 61 | $interceptor = $this->container->get($interceptor); |
| 62 | 62 | } |
| 63 | 63 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | return new Queue($core); |
| 69 | - } catch (ContainerException $e) { |
|
| 69 | + }catch (ContainerException $e){ |
|
| 70 | 70 | throw new Exception\NotSupportedDriverException( |
| 71 | 71 | \sprintf( |
| 72 | 72 | 'Driver `%s` is not supported. Connection `%s` cannot be created. Reason: `%s`', |
@@ -33,7 +33,8 @@ discard block |
||
| 33 | 33 | // Replaces alias with real pipeline name |
| 34 | 34 | $name = $this->config->getAliases()[$name] ?? $name; |
| 35 | 35 | |
| 36 | - if (!isset($this->pipelines[$name])) { |
|
| 36 | + if (!isset($this->pipelines[$name])) |
|
| 37 | + { |
|
| 37 | 38 | $this->pipelines[$name] = $this->resolveConnection($name); |
| 38 | 39 | } |
| 39 | 40 | |
@@ -48,7 +49,8 @@ discard block |
||
| 48 | 49 | { |
| 49 | 50 | $config = $this->config->getConnection($name); |
| 50 | 51 | |
| 51 | - try { |
|
| 52 | + try |
|
| 53 | + { |
|
| 52 | 54 | $driver = $this->factory->make($config['driver'], $config); |
| 53 | 55 | |
| 54 | 56 | $core = new InterceptableCore( |
@@ -56,8 +58,10 @@ discard block |
||
| 56 | 58 | $this->dispatcher |
| 57 | 59 | ); |
| 58 | 60 | |
| 59 | - foreach ($this->config->getPushInterceptors() as $interceptor) { |
|
| 60 | - if (\is_string($interceptor) || $interceptor instanceof Autowire) { |
|
| 61 | + foreach ($this->config->getPushInterceptors() as $interceptor) |
|
| 62 | + { |
|
| 63 | + if (\is_string($interceptor) || $interceptor instanceof Autowire) |
|
| 64 | + { |
|
| 61 | 65 | $interceptor = $this->container->get($interceptor); |
| 62 | 66 | } |
| 63 | 67 | |
@@ -66,7 +70,9 @@ discard block |
||
| 66 | 70 | } |
| 67 | 71 | |
| 68 | 72 | return new Queue($core); |
| 69 | - } catch (ContainerException $e) { |
|
| 73 | + } |
|
| 74 | + catch (ContainerException $e) |
|
| 75 | + { |
|
| 70 | 76 | throw new Exception\NotSupportedDriverException( |
| 71 | 77 | \sprintf( |
| 72 | 78 | 'Driver `%s` is not supported. Connection `%s` cannot be created. Reason: `%s`', |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | public function __construct( |
| 50 | 50 | private readonly ConfiguratorInterface $config |
| 51 | - ) { |
|
| 51 | + ){ |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | public function init( |
@@ -66,11 +66,11 @@ discard block |
||
| 66 | 66 | $registry = $container->get(QueueRegistry::class); |
| 67 | 67 | $config = $container->get(QueueConfig::class); |
| 68 | 68 | |
| 69 | - foreach ($config->getRegistryHandlers() as $jobType => $handler) { |
|
| 69 | + foreach ($config->getRegistryHandlers() as $jobType => $handler){ |
|
| 70 | 70 | $registry->setHandler($jobType, $handler); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - foreach ($config->getRegistrySerializers() as $jobType => $serializer) { |
|
| 73 | + foreach ($config->getRegistrySerializers() as $jobType => $serializer){ |
|
| 74 | 74 | $registry->setSerializer($jobType, $serializer); |
| 75 | 75 | } |
| 76 | 76 | }); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | /** |
| 80 | 80 | * @param class-string<CoreInterceptorInterface>|CoreInterceptorInterface|Autowire $interceptor |
| 81 | 81 | */ |
| 82 | - public function addConsumeInterceptor(string|CoreInterceptorInterface|Autowire $interceptor): void |
|
| 82 | + public function addConsumeInterceptor(string | CoreInterceptorInterface | Autowire $interceptor): void |
|
| 83 | 83 | { |
| 84 | 84 | $this->config->modify( |
| 85 | 85 | QueueConfig::CONFIG, |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | /** |
| 91 | 91 | * @param class-string<CoreInterceptorInterface>|CoreInterceptorInterface|Autowire $interceptor |
| 92 | 92 | */ |
| 93 | - public function addPushInterceptor(string|CoreInterceptorInterface|Autowire $interceptor): void |
|
| 93 | + public function addPushInterceptor(string | CoreInterceptorInterface | Autowire $interceptor): void |
|
| 94 | 94 | { |
| 95 | 95 | $this->config->modify( |
| 96 | 96 | QueueConfig::CONFIG, |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | ContainerInterface $container, |
| 116 | 116 | FactoryInterface $factory, |
| 117 | 117 | ContainerRegistry $registry |
| 118 | - ) { |
|
| 118 | + ){ |
|
| 119 | 119 | return new QueueRegistry($container, $factory, $registry); |
| 120 | 120 | } |
| 121 | 121 | |
@@ -128,10 +128,10 @@ discard block |
||
| 128 | 128 | ): Handler { |
| 129 | 129 | $core = new InterceptableCore($core, $dispatcher); |
| 130 | 130 | |
| 131 | - foreach ($config->getConsumeInterceptors() as $interceptor) { |
|
| 132 | - if (\is_string($interceptor)) { |
|
| 131 | + foreach ($config->getConsumeInterceptors() as $interceptor){ |
|
| 132 | + if (\is_string($interceptor)){ |
|
| 133 | 133 | $interceptor = $container->get($interceptor); |
| 134 | - } elseif ($interceptor instanceof Autowire) { |
|
| 134 | + } elseif ($interceptor instanceof Autowire){ |
|
| 135 | 135 | $interceptor = $interceptor->resolve($factory); |
| 136 | 136 | } |
| 137 | 137 | |
@@ -66,11 +66,13 @@ discard block |
||
| 66 | 66 | $registry = $container->get(QueueRegistry::class); |
| 67 | 67 | $config = $container->get(QueueConfig::class); |
| 68 | 68 | |
| 69 | - foreach ($config->getRegistryHandlers() as $jobType => $handler) { |
|
| 69 | + foreach ($config->getRegistryHandlers() as $jobType => $handler) |
|
| 70 | + { |
|
| 70 | 71 | $registry->setHandler($jobType, $handler); |
| 71 | 72 | } |
| 72 | 73 | |
| 73 | - foreach ($config->getRegistrySerializers() as $jobType => $serializer) { |
|
| 74 | + foreach ($config->getRegistrySerializers() as $jobType => $serializer) |
|
| 75 | + { |
|
| 74 | 76 | $registry->setSerializer($jobType, $serializer); |
| 75 | 77 | } |
| 76 | 78 | }); |
@@ -128,10 +130,14 @@ discard block |
||
| 128 | 130 | ): Handler { |
| 129 | 131 | $core = new InterceptableCore($core, $dispatcher); |
| 130 | 132 | |
| 131 | - foreach ($config->getConsumeInterceptors() as $interceptor) { |
|
| 132 | - if (\is_string($interceptor)) { |
|
| 133 | + foreach ($config->getConsumeInterceptors() as $interceptor) |
|
| 134 | + { |
|
| 135 | + if (\is_string($interceptor)) |
|
| 136 | + { |
|
| 133 | 137 | $interceptor = $container->get($interceptor); |
| 134 | - } elseif ($interceptor instanceof Autowire) { |
|
| 138 | + } |
|
| 139 | + elseif ($interceptor instanceof Autowire) |
|
| 140 | + { |
|
| 135 | 141 | $interceptor = $interceptor->resolve($factory); |
| 136 | 142 | } |
| 137 | 143 | |