This commit is contained in:
as2252258@163.com
2021-08-28 01:21:23 +08:00
parent e4a583f8dc
commit 30dae81e7e
7 changed files with 83 additions and 90 deletions
+5 -7
View File
@@ -30,15 +30,13 @@ class Response implements ResponseInterface
/**
* @param int $code
* @param string $reasonPhrase
* @return ResponseInterface
* @return static
*/
public function withStatus($code, $reasonPhrase = ''): ResponseInterface
public function withStatus($code, $reasonPhrase = ''): static
{
// TODO: Implement withStatus() method.
$class = clone $this;
$class->statusCode = $code;
$class->reasonPhrase = $reasonPhrase;
return $class;
$this->statusCode = $code;
$this->reasonPhrase = $reasonPhrase;
return $this;
}