@@ -337,9 +337,8 @@ interface IResponse
337337
338338 /**
339339 * Sets HTTP response code.
340- * @return static
341340 */
342- function setCode (int $ code , ?string $ reason = null );
341+ function setCode (int $ code , ?string $ reason = null ): static ;
343342
344343 /**
345344 * Returns HTTP response code.
@@ -348,21 +347,18 @@ function getCode(): int;
348347
349348 /**
350349 * Sends a HTTP header and replaces a previous one.
351- * @return static
352350 */
353- function setHeader (string $ name , string $ value );
351+ function setHeader (string $ name , string $ value ): static ;
354352
355353 /**
356354 * Adds HTTP header.
357- * @return static
358355 */
359- function addHeader (string $ name , string $ value );
356+ function addHeader (string $ name , string $ value ): static ;
360357
361358 /**
362359 * Sends a Content-type HTTP header.
363- * @return static
364360 */
365- function setContentType (string $ type , ?string $ charset = null );
361+ function setContentType (string $ type , ?string $ charset = null ): static ;
366362
367363 /**
368364 * Redirects to a new URL.
@@ -371,9 +367,8 @@ function redirect(string $url, int $code = self::S302_Found): void;
371367
372368 /**
373369 * Sets the time (like '20 minutes') before a page cached on a browser expires, null means "must-revalidate".
374- * @return static
375370 */
376- function setExpiration (?string $ expire );
371+ function setExpiration (?string $ expire ): static ;
377372
378373 /**
379374 * Checks if headers have been sent.
@@ -392,20 +387,25 @@ function getHeaders(): array;
392387
393388 /**
394389 * Sends a cookie.
395- * @return static
396390 */
397391 function setCookie (
398392 string $ name ,
399393 string $ value ,
400394 ?int $ expire ,
401395 ?string $ path = null ,
402396 ?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 ;
406401
407402 /**
408403 * Deletes a cookie.
409404 */
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+ );
411411}
0 commit comments