| Total Complexity | 5 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class Cookie implements ICookie |
||
| 8 | { |
||
| 9 | |||
| 10 | protected $cookie; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * instanciate |
||
| 14 | */ |
||
| 15 | 4 | public function __construct() |
|
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * get cookie value from cookie name |
||
| 22 | * |
||
| 23 | * @param string $name |
||
| 24 | * @return string |
||
| 25 | */ |
||
| 26 | 1 | public function getCookie(string $name): string |
|
| 27 | { |
||
| 28 | 1 | return (isset($this->cookie[$name])) ? $this->cookie[$name] : ''; |
|
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * set cookie value for cookie name and ttl |
||
| 33 | * |
||
| 34 | * @param string $name |
||
| 35 | * @param string $value |
||
| 36 | * @param integer $ttl |
||
| 37 | * @return Cookie |
||
| 38 | */ |
||
| 39 | 1 | public function setCookie(string $name, string $value, int $ttl): Cookie |
|
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * refresh cookie from global |
||
| 47 | * |
||
| 48 | * @return Cookie |
||
| 49 | */ |
||
| 50 | 1 | protected function refreshCookie(): Cookie |
|
| 54 | } |
||
| 55 | } |
||
| 56 |