| Total Complexity | 5 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| 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 | 7 | public function __construct(?string $value = null) |
|
| 19 | { |
||
| 20 | 7 | $this->value = $value; |
|
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @inheritDoc |
||
| 25 | */ |
||
| 26 | 7 | public function get(): ?string |
|
| 27 | { |
||
| 28 | 7 | return $this->value; |
|
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @inheritDoc |
||
| 33 | */ |
||
| 34 | 2 | public function set(string $value, int $expire): void |
|
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @inheritDoc |
||
| 42 | */ |
||
| 43 | 1 | public function clear(): void |
|
| 44 | { |
||
| 45 | 1 | $this->value = null; |
|
| 46 | 1 | $this->expire = 1; |
|
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Get expire time for the cookie. |
||
| 51 | */ |
||
| 52 | 3 | public function getExpire(): int |
|
| 55 | } |
||
| 56 | } |
||
| 57 |