@@ -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,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()); |
@@ -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 | |
@@ -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 | } |