1 | <?php |
||
22 | final class Options implements OptionsInterface |
||
23 | { |
||
24 | /** |
||
25 | * Default `time_to_live` option value is 4 weeks (it is also the maximum TTL allowed for FCM). |
||
26 | * In seconds it is 60 seconds * 60 minutes * 24 hours * 28 days = 2419200 seconds. |
||
27 | */ |
||
28 | public const DEFAULT_TTL_IN_SECONDS = 2419200; |
||
29 | |||
30 | /** @var string */ |
||
31 | private $collapseKey = ''; |
||
32 | |||
33 | /** @var string */ |
||
34 | private $priority = Priority::NORMAL; |
||
35 | |||
36 | /** @var bool */ |
||
37 | private $contentAvailable = false; |
||
38 | |||
39 | /** @var bool */ |
||
40 | private $mutableContent = false; |
||
41 | |||
42 | /** @var int */ |
||
43 | private $timeToLive = self::DEFAULT_TTL_IN_SECONDS; |
||
44 | |||
45 | /** @var string */ |
||
46 | private $restrictedPackageName = ''; |
||
47 | |||
48 | /** @var bool */ |
||
49 | private $dryRun = false; |
||
50 | |||
51 | /** |
||
52 | * @param string $collapseKey |
||
53 | * |
||
54 | * @return $this |
||
55 | */ |
||
56 | public function setCollapseKey(string $collapseKey): self |
||
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | public function getCollapseKey(): string |
||
70 | |||
71 | /** |
||
72 | * @param string $priority |
||
73 | * |
||
74 | * @return $this |
||
75 | */ |
||
76 | public function setPriority(string $priority): self |
||
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | */ |
||
86 | public function getPriority(): string |
||
90 | |||
91 | /** |
||
92 | * @param bool $contentAvailable |
||
93 | * |
||
94 | * @return $this |
||
95 | */ |
||
96 | public function setContentAvailable(bool $contentAvailable): self |
||
102 | |||
103 | /** |
||
104 | * {@inheritdoc} |
||
105 | */ |
||
106 | public function isContentAvailable(): bool |
||
110 | |||
111 | /** |
||
112 | * @param bool $mutableContent |
||
113 | */ |
||
114 | public function setMutableContent(bool $mutableContent): self |
||
120 | |||
121 | /** |
||
122 | * {@inheritdoc} |
||
123 | */ |
||
124 | public function isMutableContent(): bool |
||
128 | |||
129 | /** |
||
130 | * @param int $timeToLive |
||
131 | * |
||
132 | * @return $this |
||
133 | */ |
||
134 | public function setTimeToLive(int $timeToLive): self |
||
140 | |||
141 | /** |
||
142 | * {@inheritdoc} |
||
143 | */ |
||
144 | public function getTimeToLive(): int |
||
148 | |||
149 | /** |
||
150 | * @param string $restrictedPackageName |
||
151 | * |
||
152 | * @return $this |
||
153 | */ |
||
154 | public function setRestrictedPackageName(string $restrictedPackageName): self |
||
160 | |||
161 | /** |
||
162 | * {@inheritdoc} |
||
163 | */ |
||
164 | public function getRestrictedPackageName(): string |
||
168 | |||
169 | /** |
||
170 | * @param bool $dryRun |
||
171 | * |
||
172 | * @return $this |
||
173 | */ |
||
174 | public function setDryRun(bool $dryRun): self |
||
180 | |||
181 | /** |
||
182 | * {@inheritdoc} |
||
183 | */ |
||
184 | public function isDryRun(): bool |
||
188 | } |
||
189 |