@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | { |
21 | 21 | public function __construct( |
22 | 22 | private readonly QueueInterface $connection, |
23 | - ) { |
|
23 | + ){ |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -31,14 +31,14 @@ discard block |
||
31 | 31 | string $action, |
32 | 32 | array $parameters = ['options' => null, 'payload' => []], |
33 | 33 | ): string { |
34 | - if ($parameters['options'] === null) { |
|
34 | + if ($parameters['options'] === null){ |
|
35 | 35 | $parameters['options'] = new Options(); |
36 | 36 | } |
37 | 37 | |
38 | 38 | $tracer = $this->getTracer(); |
39 | 39 | |
40 | - if (\method_exists($parameters['options'], 'withHeader')) { |
|
41 | - foreach ($tracer->getContext() as $key => $data) { |
|
40 | + if (\method_exists($parameters['options'], 'withHeader')){ |
|
41 | + foreach ($tracer->getContext() as $key => $data){ |
|
42 | 42 | $parameters['options'] = $parameters['options']->withHeader($key, $data); |
43 | 43 | } |
44 | 44 | } |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | |
59 | 59 | private function getTracer(): TracerInterface |
60 | 60 | { |
61 | - try { |
|
61 | + try{ |
|
62 | 62 | return ContainerScope::getContainer()->get(TracerInterface::class); |
63 | - } catch (\Throwable $e) { |
|
63 | + }catch (\Throwable $e){ |
|
64 | 64 | return new NullTracer(); |
65 | 65 | } |
66 | 66 | } |
@@ -31,14 +31,17 @@ discard block |
||
31 | 31 | string $action, |
32 | 32 | array $parameters = ['options' => null, 'payload' => []], |
33 | 33 | ): string { |
34 | - if ($parameters['options'] === null) { |
|
34 | + if ($parameters['options'] === null) |
|
35 | + { |
|
35 | 36 | $parameters['options'] = new Options(); |
36 | 37 | } |
37 | 38 | |
38 | 39 | $tracer = $this->getTracer(); |
39 | 40 | |
40 | - if (\method_exists($parameters['options'], 'withHeader')) { |
|
41 | - foreach ($tracer->getContext() as $key => $data) { |
|
41 | + if (\method_exists($parameters['options'], 'withHeader')) |
|
42 | + { |
|
43 | + foreach ($tracer->getContext() as $key => $data) |
|
44 | + { |
|
42 | 45 | $parameters['options'] = $parameters['options']->withHeader($key, $data); |
43 | 46 | } |
44 | 47 | } |
@@ -58,9 +61,12 @@ discard block |
||
58 | 61 | |
59 | 62 | private function getTracer(): TracerInterface |
60 | 63 | { |
61 | - try { |
|
64 | + try |
|
65 | + { |
|
62 | 66 | return ContainerScope::getContainer()->get(TracerInterface::class); |
63 | - } catch (\Throwable $e) { |
|
67 | + } |
|
68 | + catch (\Throwable $e) |
|
69 | + { |
|
64 | 70 | return new NullTracer(); |
65 | 71 | } |
66 | 72 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | public function __construct( |
49 | 49 | private readonly ConfiguratorInterface $config, |
50 | - ) { |
|
50 | + ){ |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | public function init( |
@@ -65,11 +65,11 @@ discard block |
||
65 | 65 | $registry = $container->get(QueueRegistry::class); |
66 | 66 | $config = $container->get(QueueConfig::class); |
67 | 67 | |
68 | - foreach ($config->getRegistryHandlers() as $jobType => $handler) { |
|
68 | + foreach ($config->getRegistryHandlers() as $jobType => $handler){ |
|
69 | 69 | $registry->setHandler($jobType, $handler); |
70 | 70 | } |
71 | 71 | |
72 | - foreach ($config->getRegistrySerializers() as $jobType => $serializer) { |
|
72 | + foreach ($config->getRegistrySerializers() as $jobType => $serializer){ |
|
73 | 73 | $registry->setSerializer($jobType, $serializer); |
74 | 74 | } |
75 | 75 | }); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | /** |
79 | 79 | * @param class-string<CoreInterceptorInterface>|CoreInterceptorInterface|Autowire $interceptor |
80 | 80 | */ |
81 | - public function addConsumeInterceptor(string|CoreInterceptorInterface|Autowire $interceptor): void |
|
81 | + public function addConsumeInterceptor(string | CoreInterceptorInterface | Autowire $interceptor): void |
|
82 | 82 | { |
83 | 83 | $this->config->modify( |
84 | 84 | QueueConfig::CONFIG, |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | /** |
90 | 90 | * @param class-string<CoreInterceptorInterface>|CoreInterceptorInterface|Autowire $interceptor |
91 | 91 | */ |
92 | - public function addPushInterceptor(string|CoreInterceptorInterface|Autowire $interceptor): void |
|
92 | + public function addPushInterceptor(string | CoreInterceptorInterface | Autowire $interceptor): void |
|
93 | 93 | { |
94 | 94 | $this->config->modify( |
95 | 95 | QueueConfig::CONFIG, |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | ContainerInterface $container, |
115 | 115 | FactoryInterface $factory, |
116 | 116 | ContainerRegistry $registry, |
117 | - ) { |
|
117 | + ){ |
|
118 | 118 | return new QueueRegistry($container, $factory, $registry); |
119 | 119 | } |
120 | 120 | |
@@ -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 |