Passed
Pull Request — master (#982)
by Maxim
22:14
created
src/Queue/tests/JobHandlerLocatorListenerTest.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,9 @@
 block discarded – undo
18 18
 {
19 19
     public function testListen(): void
20 20
     {
21
-        $handler = new class($this->createMock(InvokerInterface::class)) extends JobHandler {};
21
+        $handler = new class($this->createMock(InvokerInterface::class)) extends JobHandler
22
+        {
23
+};
22 24
 
23 25
         $registry = new QueueRegistry(
24 26
             new Container(),
Please login to merge, or discard this patch.
src/Queue/tests/SerializerLocatorListenerTest.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,9 @@  discard block
 block discarded – undo
22 22
 {
23 23
     public function testListenWithJobTypeFromConfig(): void
24 24
     {
25
-        $handler = new class($this->createMock(InvokerInterface::class)) extends JobHandler {};
25
+        $handler = new class($this->createMock(InvokerInterface::class)) extends JobHandler
26
+        {
27
+};
26 28
 
27 29
         $container = new Container();
28 30
         $container->bind('test', new PhpSerializer());
@@ -58,7 +60,9 @@  discard block
 block discarded – undo
58 60
 
59 61
     public function testListenWithJobTypeFromAttribute(): void
60 62
     {
61
-        $handler = new class($this->createMock(InvokerInterface::class)) extends JobHandler {};
63
+        $handler = new class($this->createMock(InvokerInterface::class)) extends JobHandler
64
+        {
65
+};
62 66
 
63 67
         $container = new Container();
64 68
         $container->bind('test', new PhpSerializer());
Please login to merge, or discard this patch.
src/Queue/src/JobHandlerLocatorListener.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,8 @@
 block discarded – undo
21 21
     public function listen(\ReflectionClass $class): void
22 22
     {
23 23
         $attribute = $this->reader->firstClassMetadata($class, Attribute::class);
24
-        if ($attribute === null) {
24
+        if ($attribute === null)
25
+        {
25 26
             return;
26 27
         }
27 28
 
Please login to merge, or discard this patch.
src/Queue/src/SerializerLocatorListener.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,7 +28,8 @@  discard block
 block discarded – undo
28 28
     public function listen(\ReflectionClass $class): void
29 29
     {
30 30
         $attribute = $this->reader->firstClassMetadata($class, Serializer::class);
31
-        if ($attribute === null) {
31
+        if ($attribute === null)
32
+        {
32 33
             return;
33 34
         }
34 35
 
@@ -45,16 +46,20 @@  discard block
 block discarded – undo
45 46
     private function getJobType(\ReflectionClass $class): string
46 47
     {
47 48
         $attribute = $this->reader->firstClassMetadata($class, JobHandlerAttribute::class);
48
-        if ($attribute !== null) {
49
+        if ($attribute !== null)
50
+        {
49 51
             return $attribute->type;
50 52
         }
51 53
 
52
-        foreach ($this->config->getRegistryHandlers() as $jobType => $handler) {
53
-            if (\is_object($handler)) {
54
+        foreach ($this->config->getRegistryHandlers() as $jobType => $handler)
55
+        {
56
+            if (\is_object($handler))
57
+            {
54 58
                 $handler = $handler::class;
55 59
             }
56 60
 
57
-            if ($handler === $class->getName()) {
61
+            if ($handler === $class->getName())
62
+            {
58 63
                 return $jobType;
59 64
             }
60 65
         }
Please login to merge, or discard this patch.