1 | <?php declare(strict_types = 1); |
||
20 | final class CookieJar implements IteratorAggregate, CookieJarContract |
||
21 | { |
||
22 | |||
23 | /** |
||
24 | * @var CookieContract[] |
||
25 | */ |
||
26 | private $cookies = []; |
||
27 | |||
28 | /** |
||
29 | * @inheritDoc |
||
30 | */ |
||
31 | 4 | public function add( |
|
43 | |||
44 | /** |
||
45 | * @inheritDoc |
||
46 | */ |
||
47 | 2 | public function all(): array |
|
51 | |||
52 | /** |
||
53 | * @inheritDoc |
||
54 | */ |
||
55 | 5 | public function findByName(string $name) |
|
59 | |||
60 | /** |
||
61 | * @inheritDoc |
||
62 | */ |
||
63 | 1 | public function forever( |
|
73 | |||
74 | /** |
||
75 | * @inheritDoc |
||
76 | */ |
||
77 | 1 | public function forget(string $name) |
|
81 | |||
82 | /** |
||
83 | * @inheritDoc |
||
84 | */ |
||
85 | 1 | public function getIterator() |
|
89 | |||
90 | /** |
||
91 | * @inheritDoc |
||
92 | */ |
||
93 | 6 | public function put(CookieContract $cookie) |
|
97 | |||
98 | /** |
||
99 | * @inheritDoc |
||
100 | */ |
||
101 | 1 | public function session( |
|
111 | |||
112 | /** |
||
113 | * Parses expiration time and returns valid DateTimeInterface implementation. |
||
114 | * |
||
115 | * @param DateTimeInterface|DateInterval|string $expires |
||
116 | * @return DateTimeInterface |
||
117 | * @throws InvalidArgumentException |
||
118 | */ |
||
119 | 4 | private function expirationToDateTime($expires): DateTimeInterface |
|
139 | |||
140 | } |