| Total Complexity | 6 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | final class Task implements TaskInterface |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @param non-empty-string $id Unique identifier of the task in the queue. |
||
|
|
|||
| 11 | * @param non-empty-string $queue broker queue name. |
||
| 12 | * @param non-empty-string $name name of the task/job. |
||
| 13 | * @param mixed $payload payload of the task/job. |
||
| 14 | * @param array<non-empty-string, array<string>> $headers headers of the task/job. |
||
| 15 | */ |
||
| 16 | 5 | public function __construct( |
|
| 17 | private readonly string $id, |
||
| 18 | private readonly string $queue, |
||
| 19 | private readonly string $name, |
||
| 20 | private readonly mixed $payload, |
||
| 21 | private readonly array $headers, |
||
| 22 | ) { |
||
| 23 | 5 | } |
|
| 24 | |||
| 25 | 1 | public function getPayload(): mixed |
|
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @return non-empty-string |
||
| 32 | */ |
||
| 33 | 1 | public function getName(): string |
|
| 34 | { |
||
| 35 | 1 | return $this->name; |
|
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @return array<non-empty-string, array<string>> |
||
| 40 | */ |
||
| 41 | 1 | public function getHeaders(): array |
|
| 42 | { |
||
| 43 | 1 | return $this->headers; |
|
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @return non-empty-string |
||
| 48 | */ |
||
| 49 | 1 | public function getQueue(): string |
|
| 50 | { |
||
| 51 | 1 | return $this->queue; |
|
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @return non-empty-string |
||
| 56 | */ |
||
| 57 | 1 | public function getId(): string |
|
| 60 | } |
||
| 61 | } |
||
| 62 |