for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/**
* @author : Korotkov Danila <[email protected]>
* @copyright Copyright (c) 2016, Korotkov Danila
* @license http://www.gnu.org/licenses/gpl.html GNU GPLv3.0
*/
namespace Rudra\Traits;
* Trait ContainerCookieTrait
* @package Rudra
trait ContainerCookieTrait
{
* @param string $key
* @return string
public function getCookie(string $key): string
return $_COOKIE[$key];
}
* @return bool
public function hasCookie(string $key): bool
return isset($_COOKIE[$key]);
* @codeCoverageIgnore
public function unsetCookie(string $key): void
unset($_COOKIE[$key]);
setcookie($key, '', -1, '/');
* @param string $value
public function setCookie(string $key, string $value): void
$_COOKIE[$key] = $value;