Total Complexity | 5 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | class CookieValue implements CookieInterface |
||
11 | { |
||
12 | protected ?string $value; |
||
13 | protected int $expire = 0; |
||
14 | |||
15 | /** |
||
16 | * Cookies constructor. |
||
17 | */ |
||
18 | public function __construct(?string $value = null) |
||
19 | { |
||
20 | $this->value = $value; |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * @inheritDoc |
||
25 | */ |
||
26 | public function get(): ?string |
||
27 | { |
||
28 | return $this->value; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @inheritDoc |
||
33 | */ |
||
34 | public function set(string $value, int $expire): void |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @inheritDoc |
||
42 | */ |
||
43 | public function clear(): void |
||
44 | { |
||
45 | $this->value = null; |
||
46 | $this->expire = 1; |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * Get expire time for the cookie. |
||
51 | */ |
||
52 | public function getExpire(): int |
||
55 | } |
||
56 | } |
||
57 |