1 | <?php |
||
11 | class Cookies |
||
12 | { |
||
13 | /** |
||
14 | * The name of the Cookie header. |
||
15 | */ |
||
16 | public const COOKIE_HEADER = 'Cookie'; |
||
17 | |||
18 | /** @var Cookie[] */ |
||
19 | private $cookies = []; |
||
20 | |||
21 | /** @param Cookie[] $cookies */ |
||
22 | 23 | public function __construct(array $cookies = []) |
|
28 | |||
29 | public function has(string $name) : bool |
||
33 | 15 | ||
34 | public function get(string $name) : ?Cookie |
||
42 | 10 | ||
43 | /** @return Cookie[] */ |
||
44 | 10 | public function getAll() : array |
|
48 | 10 | ||
49 | public function with(Cookie $cookie) : Cookies |
||
57 | |||
58 | public function without(string $name) : Cookies |
||
70 | |||
71 | /** |
||
72 | * Render Cookies into a Request. |
||
73 | */ |
||
74 | public function renderIntoCookieHeader(RequestInterface $request) : RequestInterface |
||
82 | |||
83 | /** |
||
84 | 3 | * Create Cookies from a Cookie header value string. |
|
85 | * |
||
86 | 3 | * @return static |
|
87 | */ |
||
88 | public static function fromCookieString(string $string) : self |
||
92 | |||
93 | public static function fromRequest(RequestInterface $request) : Cookies |
||
99 | } |
||
100 |