Total Complexity | 4 |
Total Lines | 66 |
Duplicated Lines | 0 % |
Changes | 8 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
22 | class CookiesVariable |
||
23 | { |
||
24 | /** |
||
25 | * Set a cookie |
||
26 | */ |
||
27 | public function set( |
||
28 | string $name = "", |
||
29 | string $value = "", |
||
30 | int $expire = 0, |
||
31 | string $path = "/", |
||
32 | string $domain = "", |
||
33 | bool $secure = false, |
||
34 | bool $httpOnly = false, |
||
35 | string $sameSite = 'Lax', |
||
36 | ): void { |
||
37 | Cookies::$plugin->cookies->set( |
||
38 | $name, |
||
39 | $value, |
||
40 | $expire, |
||
41 | $path, |
||
42 | $domain, |
||
43 | $secure, |
||
44 | $httpOnly, |
||
45 | $sameSite |
||
46 | ); |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * Get a cookie |
||
51 | */ |
||
52 | public function get(string $name): string |
||
53 | { |
||
54 | return Cookies::$plugin->cookies->get($name); |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * Set a secure cookie |
||
59 | */ |
||
60 | public function setSecure( |
||
79 | ); |
||
80 | } |
||
81 | |||
82 | /** |
||
83 | * Get a secure cookie |
||
84 | */ |
||
85 | public function getSecure(string $name): string |
||
88 | } |
||
89 | } |
||
90 |