Passed
Pull Request — master (#592)
by Aleksei
06:09
created
src/Queue/tests/Core/QueueInjectorTest.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
                     'sync' => $this->defaultQueue,
87 87
                     'test' => new TestQueueClass(),
88 88
                 ][$name] ?? null;
89
-            if ($result === null) {
89
+            if ($result === null){
90 90
                 throw new NotFoundException();
91 91
             }
92 92
             return $result;
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,8 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Queue/src/QueueManager.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
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
             $this->pipelines[$name] = $this->resolveConnection($name);
34 34
         }
35 35
 
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
     {
45 45
         $config = $this->config->getConnection($name);
46 46
 
47
-        try {
47
+        try{
48 48
             return $this->factory->make($config['driver'], $config);
49
-        } catch (ContainerException $e) {
49
+        }catch (ContainerException $e){
50 50
             throw new Exception\NotSupportedDriverException(
51 51
                 \sprintf(
52 52
                     'Driver `%s` is not supported. Connection `%s` cannot be created. Reason: `%s`',
Please login to merge, or discard this patch.
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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`',
Please login to merge, or discard this patch.
src/Queue/src/Core/QueueInjector.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,13 +24,13 @@  discard block
 block discarded – undo
24 24
 
25 25
     public function createInjection(ReflectionClass $class, string $context = null): QueueInterface
26 26
     {
27
-        if ($context === null) {
27
+        if ($context === null){
28 28
             $connection = $this->queueManager->getConnection();
29
-        } else {
29
+        }else{
30 30
             // Get Queue by context
31
-            try {
31
+            try{
32 32
                 $connection = $this->queueManager->getConnection($context);
33
-            } catch (InvalidArgumentException $e) {
33
+            }catch (InvalidArgumentException $e){
34 34
                 // Case when context doesn't match to configured connections
35 35
                 return $this->queueManager->getConnection();
36 36
             }
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
         // User specified a specific class type
40 40
         $className = $class->getName();
41
-        if ($className !== QueueInterface::class && !$connection instanceof $className) {
41
+        if ($className !== QueueInterface::class && !$connection instanceof $className){
42 42
             throw new \RuntimeException(
43 43
                 \sprintf(
44 44
                     "The queue obtained by the context `%s` doesn't match the type `%s`.",
Please login to merge, or discard this patch.
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,13 +24,19 @@  discard block
 block discarded – undo
24 24
 
25 25
     public function createInjection(ReflectionClass $class, string $context = null): QueueInterface
26 26
     {
27
-        if ($context === null) {
27
+        if ($context === null)
28
+        {
28 29
             $connection = $this->queueManager->getConnection();
29
-        } else {
30
+        }
31
+        else
32
+        {
30 33
             // Get Queue by context
31
-            try {
34
+            try
35
+            {
32 36
                 $connection = $this->queueManager->getConnection($context);
33
-            } catch (InvalidArgumentException $e) {
37
+            }
38
+            catch (InvalidArgumentException $e)
39
+            {
34 40
                 // Case when context doesn't match to configured connections
35 41
                 return $this->queueManager->getConnection();
36 42
             }
@@ -38,7 +44,8 @@  discard block
 block discarded – undo
38 44
 
39 45
         // User specified a specific class type
40 46
         $className = $class->getName();
41
-        if ($className !== QueueInterface::class && !$connection instanceof $className) {
47
+        if ($className !== QueueInterface::class && !$connection instanceof $className)
48
+        {
42 49
             throw new \RuntimeException(
43 50
                 \sprintf(
44 51
                     "The queue obtained by the context `%s` doesn't match the type `%s`.",
Please login to merge, or discard this patch.