1 | <?php |
||
11 | class SetCookies |
||
12 | { |
||
13 | /** |
||
14 | * The name of the Set-Cookie header. |
||
15 | */ |
||
16 | public const SET_COOKIE_HEADER = 'Set-Cookie'; |
||
17 | |||
18 | /** @var SetCookie[] */ |
||
19 | private $setCookies = []; |
||
20 | |||
21 | /** @param SetCookie[] $setCookies */ |
||
22 | 22 | public function __construct(array $setCookies = []) |
|
28 | |||
29 | public function has(string $name) : bool |
||
33 | 13 | ||
34 | public function get(string $name) : ?SetCookie |
||
42 | 7 | ||
43 | /** @return SetCookie[] */ |
||
44 | 7 | public function getAll() : array |
|
48 | 6 | ||
49 | public function with(SetCookie $setCookie) : SetCookies |
||
57 | |||
58 | public function without(string $name) : SetCookies |
||
70 | |||
71 | /** |
||
72 | * Render SetCookies into a Response. |
||
73 | * |
||
74 | */ |
||
75 | public function renderIntoSetCookieHeader(ResponseInterface $response) : ResponseInterface |
||
84 | 2 | ||
85 | /** |
||
86 | 2 | * Create SetCookies from a collection of SetCookie header value strings. |
|
87 | * |
||
88 | * @param string[] $setCookieStrings |
||
89 | * @return static |
||
90 | */ |
||
91 | public static function fromSetCookieStrings(array $setCookieStrings) : self |
||
97 | 6 | ||
98 | 6 | /** |
|
99 | 6 | * Create SetCookies from a Response. |
|
100 | 6 | * |
|
101 | */ |
||
102 | 6 | public static function fromResponse(ResponseInterface $response) : SetCookies |
|
108 | } |
||
109 |