Total Complexity | 4 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
6 | final class DeliveryMode |
||
7 | { |
||
8 | private const NON_PERSISTENT = 1; |
||
9 | private const PERSISTENT = 2; |
||
10 | |||
11 | private static $nonPersistent; |
||
12 | private static $persistent; |
||
13 | |||
14 | private $mode; |
||
15 | |||
16 | 4 | private function __construct(int $mode) |
|
17 | { |
||
18 | 4 | $this->mode = $mode; |
|
19 | 4 | } |
|
20 | |||
21 | /** |
||
22 | * Message will be lost in case of server crash |
||
23 | */ |
||
24 | 4 | public static function nonPersistent(): self |
|
27 | } |
||
28 | |||
29 | /** |
||
30 | * Will persist the message to disk on the server, meaning it will be restored |
||
31 | * in case of a server crash (applies only to durable queues) |
||
32 | */ |
||
33 | 14 | public static function persistent(): self |
|
36 | } |
||
37 | |||
38 | 12 | public function toInt(): int |
|
43 |