Skip to content

Commit a6372bf

Browse files
author
Trevor North
committed
Add ResponseInterface php return type hint back to Response
This makes best use of native and analysis checks of extendable responses.
1 parent 608654f commit a6372bf

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Response.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ public function withStatus($code, $reasonPhrase = '')
335335
* @param int $depth Json encoding max depth
336336
* @return static
337337
*/
338-
public function withJson($data, int $status = null, int $options = 0, int $depth = 512)
338+
public function withJson($data, int $status = null, int $options = 0, int $depth = 512): ResponseInterface
339339
{
340340
$json = (string) json_encode($data, $options, $depth);
341341

@@ -366,7 +366,7 @@ public function withJson($data, int $status = null, int $options = 0, int $depth
366366
* @param int|null $status The redirect HTTP status code.
367367
* @return static
368368
*/
369-
public function withRedirect(string $url, $status = null)
369+
public function withRedirect(string $url, $status = null): ResponseInterface
370370
{
371371
$response = $this->response->withHeader('Location', $url);
372372

@@ -388,7 +388,7 @@ public function withRedirect(string $url, $status = null)
388388
* @param string $data
389389
* @return static
390390
*/
391-
public function write($data)
391+
public function write($data): ResponseInterface
392392
{
393393
$this->response->getBody()->write($data);
394394
return $this;

0 commit comments

Comments
 (0)