Total Complexity | 6 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
13 | class Cookies implements \ArrayAccess |
||
14 | { |
||
15 | /** @var int */ |
||
16 | protected int $ttl; |
||
17 | |||
18 | /** @var string */ |
||
19 | protected string $path; |
||
20 | |||
21 | /** @var string */ |
||
22 | protected string $domain; |
||
23 | |||
24 | /** @var bool */ |
||
25 | protected bool $secure; |
||
26 | |||
27 | public function __construct(int $ttl = 3600, string $path = '', string $domain = '', bool $secure = false) |
||
28 | { |
||
29 | $this->ttl = $ttl; |
||
30 | $this->path = $path; |
||
31 | $this->domain = $domain; |
||
32 | $this->secure = $secure; |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @inheritDoc |
||
37 | */ |
||
38 | public function offsetExists(mixed $offset): bool |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @inheritDoc |
||
45 | */ |
||
46 | public function offsetGet(mixed $offset): mixed |
||
47 | { |
||
48 | return $_COOKIE[$offset] ?? null; |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * @inheritDoc |
||
53 | */ |
||
54 | public function offsetSet(mixed $offset, mixed $value): void |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * @inheritDoc |
||
67 | */ |
||
68 | public function offsetUnset(mixed $offset): void |
||
72 | } |
||
73 | } |
||
74 |