@@ -337,9 +337,8 @@ interface IResponse
337
337
338
338
/**
339
339
* Sets HTTP response code.
340
- * @return static
341
340
*/
342
- function setCode (int $ code , ?string $ reason = null );
341
+ function setCode (int $ code , ?string $ reason = null ): static ;
343
342
344
343
/**
345
344
* Returns HTTP response code.
@@ -348,21 +347,18 @@ function getCode(): int;
348
347
349
348
/**
350
349
* Sends a HTTP header and replaces a previous one.
351
- * @return static
352
350
*/
353
- function setHeader (string $ name , string $ value );
351
+ function setHeader (string $ name , string $ value ): static ;
354
352
355
353
/**
356
354
* Adds HTTP header.
357
- * @return static
358
355
*/
359
- function addHeader (string $ name , string $ value );
356
+ function addHeader (string $ name , string $ value ): static ;
360
357
361
358
/**
362
359
* Sends a Content-type HTTP header.
363
- * @return static
364
360
*/
365
- function setContentType (string $ type , ?string $ charset = null );
361
+ function setContentType (string $ type , ?string $ charset = null ): static ;
366
362
367
363
/**
368
364
* Redirects to a new URL.
@@ -371,9 +367,8 @@ function redirect(string $url, int $code = self::S302_Found): void;
371
367
372
368
/**
373
369
* Sets the time (like '20 minutes') before a page cached on a browser expires, null means "must-revalidate".
374
- * @return static
375
370
*/
376
- function setExpiration (?string $ expire );
371
+ function setExpiration (?string $ expire ): static ;
377
372
378
373
/**
379
374
* Checks if headers have been sent.
@@ -392,20 +387,25 @@ function getHeaders(): array;
392
387
393
388
/**
394
389
* Sends a cookie.
395
- * @return static
396
390
*/
397
391
function setCookie (
398
392
string $ name ,
399
393
string $ value ,
400
394
?int $ expire ,
401
395
?string $ path = null ,
402
396
?string $ domain = null ,
403
- ?bool $ secure = null ,
404
- ?bool $ httpOnly = null ,
405
- );
397
+ bool $ secure = false ,
398
+ bool $ httpOnly = true ,
399
+ string $ sameSite = self ::SameSiteLax,
400
+ ): static ;
406
401
407
402
/**
408
403
* Deletes a cookie.
409
404
*/
410
- function deleteCookie (string $ name , ?string $ path = null , ?string $ domain = null , ?bool $ secure = null );
405
+ function deleteCookie (
406
+ string $ name ,
407
+ ?string $ path = null ,
408
+ ?string $ domain = null ,
409
+ bool $ secure = false ,
410
+ );
411
411
}
0 commit comments