Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
45 | public function set(string $value, int $expire): void |
||
46 | { |
||
47 | $success = setcookie($this->name, $value, ['expire' => $expire] + $this->options); |
||
48 | |||
49 | if (!$success) { |
||
50 | throw new \RuntimeException("Failed to set cookie '{$this->name}'"); |
||
51 | } |
||
52 | |||
53 | $_COOKIE[$this->name] = $value; |
||
54 | } |
||
70 |