@@ -31,7 +31,7 @@ public function reset(): void
31
31
$ this ->headers = [];
32
32
}
33
33
34
- public function setCode (int $ code ): Response
34
+ public function setCode (int $ code ): self
35
35
{
36
36
$ this ->code = $ code ;
37
37
@@ -43,21 +43,21 @@ public function getCode(): int
43
43
return $ this ->code ;
44
44
}
45
45
46
- public function setHeader (string $ name , string $ value ): Response
46
+ public function setHeader (string $ name , string $ value ): self
47
47
{
48
48
$ this ->headers [$ name ] = $ value ;
49
49
50
50
return $ this ;
51
51
}
52
52
53
- public function addHeader (string $ name , string $ value ): Response
53
+ public function addHeader (string $ name , string $ value ): self
54
54
{
55
55
$ this ->headers [$ name ] = $ value ;
56
56
57
57
return $ this ;
58
58
}
59
59
60
- public function setContentType (string $ type , ?string $ charset = null ): Response
60
+ public function setContentType (string $ type , ?string $ charset = null ): self
61
61
{
62
62
$ this ->setHeader ('Content-Type ' , $ type .($ charset ? '; charset= ' .$ charset : '' ));
63
63
@@ -73,7 +73,7 @@ public function redirect(string $url, int $code = self::S302_FOUND): void
73
73
/**
74
74
* @param string|int|DateTime $time
75
75
*/
76
- public function setExpiration ($ time ): Response
76
+ public function setExpiration ($ time ): self
77
77
{
78
78
if (!$ time ) {
79
79
$ this ->setHeader ('Cache-Control ' , 's-maxage=0, max-age=0, must-revalidate ' );
@@ -107,7 +107,7 @@ public function getHeaders(): array
107
107
/**
108
108
* @param string|int|DateTime $time
109
109
*/
110
- public function setCookie (string $ name , string $ value , $ time , ?string $ path = null , ?string $ domain = null , ?bool $ secure = null , ?bool $ httpOnly = null , ?string $ sameSite = null ): Response
110
+ public function setCookie (string $ name , string $ value , $ time , ?string $ path = null , ?string $ domain = null , ?bool $ secure = null , ?bool $ httpOnly = null , ?string $ sameSite = null ): self
111
111
{
112
112
return $ this ;
113
113
}
0 commit comments