Total Complexity | 8 |
Total Lines | 67 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class Update extends GenericUpdate |
||
10 | { |
||
11 | public const LOW_PRIORITY = 'LOW_PRIORITY'; |
||
12 | public const IGNORE = 'IGNORE'; |
||
13 | |||
14 | /** @var array<int,string> */ |
||
15 | protected array $modifiers = []; |
||
16 | |||
17 | protected ?int $limit = null; |
||
18 | |||
19 | /** |
||
20 | * @param string ...$modifiers |
||
21 | * |
||
22 | * @return $this |
||
23 | */ |
||
24 | 1 | public function modifier(string ...$modifiers): static |
|
25 | { |
||
26 | 1 | foreach ($modifiers as $modifier) { |
|
27 | switch ($modifier) { |
||
28 | 1 | case static::LOW_PRIORITY: |
|
29 | 1 | $this->modifiers[0] = $modifier; |
|
30 | 1 | break; |
|
31 | 1 | case static::IGNORE: |
|
32 | 1 | $this->modifiers[1] = $modifier; |
|
33 | 1 | break; |
|
34 | } |
||
35 | } |
||
36 | |||
37 | 1 | return $this; |
|
38 | } |
||
39 | |||
40 | /** |
||
41 | * @param int|null $limit |
||
42 | * |
||
43 | * @return $this |
||
44 | */ |
||
45 | 1 | public function limit(?int $limit): static |
|
46 | { |
||
47 | 1 | $this->limit = $limit; |
|
48 | |||
49 | 1 | return $this; |
|
50 | } |
||
51 | |||
52 | /** |
||
53 | * @return string |
||
54 | */ |
||
55 | 3 | public function __toString(): string |
|
63 | } |
||
64 | |||
65 | /** |
||
66 | * @return string[] |
||
67 | */ |
||
68 | 2 | protected function getLimit(): array |
|
78 |