1 | <?php declare(strict_types = 1); |
||
16 | class Cookie implements CookieContract |
||
17 | { |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $domain = ''; |
||
23 | |||
24 | /** |
||
25 | * @var DateTimeInterface|null |
||
26 | */ |
||
27 | private $expires = null; |
||
28 | |||
29 | /** |
||
30 | * @var bool |
||
31 | */ |
||
32 | private $httpOnly = false; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | private $name; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | private $path = ''; |
||
43 | |||
44 | /** |
||
45 | * @var bool |
||
46 | */ |
||
47 | private $secure = false; |
||
48 | |||
49 | /** |
||
50 | * @var string |
||
51 | */ |
||
52 | private $value = ''; |
||
53 | |||
54 | /** |
||
55 | * Cookie constructor. |
||
56 | * |
||
57 | * @param string $name |
||
58 | * @param string $value |
||
|
|||
59 | * @param DateTimeInterface|null $expires |
||
60 | * @param string $path |
||
61 | * @param string $domain |
||
62 | * @param bool $secure |
||
63 | * @param bool $httpOnly |
||
64 | * @throws InvalidArgumentException |
||
65 | */ |
||
66 | public function __construct( |
||
91 | |||
92 | /** |
||
93 | * @inheritDoc |
||
94 | */ |
||
95 | public function __toString() |
||
134 | |||
135 | /** |
||
136 | * @inheritDoc |
||
137 | */ |
||
138 | public function domain(): string |
||
142 | |||
143 | /** |
||
144 | * @inheritDoc |
||
145 | */ |
||
146 | public function expires() |
||
150 | |||
151 | /** |
||
152 | * @inheritDoc |
||
153 | */ |
||
154 | public function httpOnly(): CookieContract |
||
161 | |||
162 | /** |
||
163 | * @inheritDoc |
||
164 | */ |
||
165 | public function isHttpOnly(): bool |
||
169 | |||
170 | /** |
||
171 | * @inheritDoc |
||
172 | */ |
||
173 | public function isSecure(): bool |
||
177 | |||
178 | /** |
||
179 | * @inheritDoc |
||
180 | */ |
||
181 | public function name(): string |
||
185 | |||
186 | /** |
||
187 | * @inheritDoc |
||
188 | */ |
||
189 | public function path(): string |
||
193 | |||
194 | /** |
||
195 | * @inheritDoc |
||
196 | */ |
||
197 | public function secured(): CookieContract |
||
204 | |||
205 | /** |
||
206 | * @inheritDoc |
||
207 | */ |
||
208 | public function value(): string |
||
212 | |||
213 | /** |
||
214 | * @inheritDoc |
||
215 | */ |
||
216 | public function withDomain(string $domain): CookieContract |
||
223 | |||
224 | /** |
||
225 | * @inheritDoc |
||
226 | */ |
||
227 | public function withExpires(DateTimeInterface $expires = null): CookieContract |
||
234 | |||
235 | /** |
||
236 | * @inheritDoc |
||
237 | */ |
||
238 | public function withPath(string $path): CookieContract |
||
245 | |||
246 | /** |
||
247 | * @inheritDoc |
||
248 | */ |
||
249 | public function withValue(string $value): CookieContract |
||
256 | |||
257 | /** |
||
258 | * Creates immutable date time instance from provided one. |
||
259 | * |
||
260 | * @param DateTimeInterface $expires |
||
261 | * @return DateTimeImmutable |
||
262 | */ |
||
263 | private function lockExpires(DateTimeInterface $expires): DateTimeImmutable |
||
271 | } |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.