@@ -18,7 +18,7 @@ |
||
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 | 22 | |
23 | 23 | $registry = new QueueRegistry( |
24 | 24 | new Container(), |
@@ -18,7 +18,9 @@ |
||
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(), |
@@ -22,7 +22,7 @@ discard block |
||
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 | 26 | |
27 | 27 | $container = new Container(); |
28 | 28 | $container->bind('test', new PhpSerializer()); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | public function testListenWithJobTypeFromAttribute(): void |
60 | 60 | { |
61 | - $handler = new class($this->createMock(InvokerInterface::class)) extends JobHandler {}; |
|
61 | + $handler = new class($this->createMock(InvokerInterface::class)) extends JobHandler{}; |
|
62 | 62 | |
63 | 63 | $container = new Container(); |
64 | 64 | $container->bind('test', new PhpSerializer()); |
@@ -22,7 +22,9 @@ discard block |
||
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 |
||
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()); |
@@ -15,13 +15,13 @@ |
||
15 | 15 | public function __construct( |
16 | 16 | private readonly ReaderInterface $reader, |
17 | 17 | private readonly QueueRegistry $registry |
18 | - ) { |
|
18 | + ){ |
|
19 | 19 | } |
20 | 20 | |
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 | return; |
26 | 26 | } |
27 | 27 |
@@ -21,7 +21,8 @@ |
||
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 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | private readonly ReaderInterface $reader, |
20 | 20 | private readonly QueueRegistry $registry, |
21 | 21 | private readonly QueueConfig $config |
22 | - ) { |
|
22 | + ){ |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
@@ -28,7 +28,7 @@ discard block |
||
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 | return; |
33 | 33 | } |
34 | 34 | |
@@ -45,16 +45,16 @@ discard block |
||
45 | 45 | private function getJobType(\ReflectionClass $class): string |
46 | 46 | { |
47 | 47 | $attribute = $this->reader->firstClassMetadata($class, JobHandlerAttribute::class); |
48 | - if ($attribute !== null) { |
|
48 | + if ($attribute !== null){ |
|
49 | 49 | return $attribute->type; |
50 | 50 | } |
51 | 51 | |
52 | - foreach ($this->config->getRegistryHandlers() as $jobType => $handler) { |
|
53 | - if (\is_object($handler)) { |
|
52 | + foreach ($this->config->getRegistryHandlers() as $jobType => $handler){ |
|
53 | + if (\is_object($handler)){ |
|
54 | 54 | $handler = $handler::class; |
55 | 55 | } |
56 | 56 | |
57 | - if ($handler === $class->getName()) { |
|
57 | + if ($handler === $class->getName()){ |
|
58 | 58 | return $jobType; |
59 | 59 | } |
60 | 60 | } |
@@ -28,7 +28,8 @@ discard block |
||
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 |
||
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 | } |
@@ -22,6 +22,6 @@ |
||
22 | 22 | { |
23 | 23 | public function __construct( |
24 | 24 | public readonly string $serializer |
25 | - ) { |
|
25 | + ){ |
|
26 | 26 | } |
27 | 27 | } |
@@ -22,6 +22,6 @@ |
||
22 | 22 | { |
23 | 23 | public function __construct( |
24 | 24 | public readonly string $type |
25 | - ) { |
|
25 | + ){ |
|
26 | 26 | } |
27 | 27 | } |