Skip to content

Commit fde49c2

Browse files
committed
IResponse: added missing methods (BC break)
1 parent effc190 commit fde49c2

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

src/Http/IResponse.php

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
/**
1414
* HTTP response interface.
15-
* @method self deleteHeader(string $name)
1615
*/
1716
interface IResponse
1817
{
@@ -141,6 +140,17 @@ interface IResponse
141140
511 => 'Network Authentication Required',
142141
];
143142

143+
/**
144+
* Sets HTTP protocol version.
145+
* @return static
146+
*/
147+
function setProtocolVersion(string $version);
148+
149+
/**
150+
* Returns HTTP protocol version.
151+
*/
152+
function getProtocolVersion(): string;
153+
144154
/**
145155
* Sets HTTP response code.
146156
* @return static
@@ -152,6 +162,11 @@ function setCode(int $code, string $reason = null);
152162
*/
153163
function getCode(): int;
154164

165+
/**
166+
* Returns HTTP reason phrase.
167+
*/
168+
function getReasonPhrase(): string;
169+
155170
/**
156171
* Sends a HTTP header and replaces a previous one.
157172
* @return static
@@ -164,6 +179,11 @@ function setHeader(string $name, string $value);
164179
*/
165180
function addHeader(string $name, string $value);
166181

182+
/**
183+
* @return static
184+
*/
185+
function deleteHeader(string $name);
186+
167187
/**
168188
* Sends a Content-type HTTP header.
169189
* @return static
@@ -197,10 +217,21 @@ function getHeaders(): array;
197217
* @param string|int|\DateTimeInterface $expire time, value 0 means "until the browser is closed"
198218
* @return static
199219
*/
200-
function setCookie(string $name, string $value, $expire, string $path = null, string $domain = null, bool $secure = null, bool $httpOnly = null);
220+
function setCookie(string $name, string $value, $expire, string $path = null, string $domain = null, bool $secure = null, bool $httpOnly = null, string $sameSite = null);
201221

202222
/**
203223
* Deletes a cookie.
204224
*/
205225
function deleteCookie(string $name, string $path = null, string $domain = null, bool $secure = null);
226+
227+
/**
228+
* @param string|\Closure $body
229+
* @return static
230+
*/
231+
function setBody($body);
232+
233+
/**
234+
* @return string|\Closure
235+
*/
236+
function getBody();
206237
}

0 commit comments

Comments
 (0)