@@ -86,7 +86,8 @@ |
||
86 | 86 | 'sync' => $this->defaultQueue, |
87 | 87 | 'test' => new TestQueueClass(), |
88 | 88 | ][$name] ?? null; |
89 | - if ($result === null) { |
|
89 | + if ($result === null) |
|
90 | + { |
|
90 | 91 | throw new NotFoundException(); |
91 | 92 | } |
92 | 93 | return $result; |
@@ -22,12 +22,18 @@ discard block |
||
22 | 22 | public function createInjection(ReflectionClass $class, string $context = null): QueueInterface |
23 | 23 | { |
24 | 24 | // Get Queue by context |
25 | - if ($context === null) { |
|
25 | + if ($context === null) |
|
26 | + { |
|
26 | 27 | $connection = $this->queueManager->getConnection(); |
27 | - } else { |
|
28 | - try { |
|
28 | + } |
|
29 | + else |
|
30 | + { |
|
31 | + try |
|
32 | + { |
|
29 | 33 | $connection = $this->queueManager->getConnection($context); |
30 | - } catch (InvalidArgumentException $e) { |
|
34 | + } |
|
35 | + catch (InvalidArgumentException $e) |
|
36 | + { |
|
31 | 37 | // Case when context doesn't match to configured connections |
32 | 38 | return $this->queueManager->getConnection(); |
33 | 39 | } |
@@ -35,7 +41,8 @@ discard block |
||
35 | 41 | |
36 | 42 | // User specified a specific class type |
37 | 43 | $className = $class->getName(); |
38 | - if ($className !== QueueInterface::class && !$connection instanceof $className) { |
|
44 | + if ($className !== QueueInterface::class && !$connection instanceof $className) |
|
45 | + { |
|
39 | 46 | throw new \RuntimeException( |
40 | 47 | \sprintf( |
41 | 48 | "The queue obtained by the context `%s` doesn't match the type `%s`.", |
@@ -29,7 +29,8 @@ discard block |
||
29 | 29 | // Replaces alias with real pipeline name |
30 | 30 | $name = $this->config->getAliases()[$name] ?? $name; |
31 | 31 | |
32 | - if (!isset($this->pipelines[$name])) { |
|
32 | + if (!isset($this->pipelines[$name])) |
|
33 | + { |
|
33 | 34 | $this->pipelines[$name] = $this->resolveConnection($name); |
34 | 35 | } |
35 | 36 | |
@@ -44,9 +45,12 @@ discard block |
||
44 | 45 | { |
45 | 46 | $config = $this->config->getConnection($name); |
46 | 47 | |
47 | - try { |
|
48 | + try |
|
49 | + { |
|
48 | 50 | return $this->factory->make($config['driver'], $config); |
49 | - } catch (ContainerException $e) { |
|
51 | + } |
|
52 | + catch (ContainerException $e) |
|
53 | + { |
|
50 | 54 | throw new Exception\NotSupportedDriverException( |
51 | 55 | \sprintf( |
52 | 56 | 'Driver `%s` is not supported. Connection `%s` cannot be created. Reason: `%s`', |