This commit is contained in:
2021-09-10 10:24:11 +08:00
parent c02da89654
commit dca5d3e6ec
8 changed files with 955 additions and 957 deletions
+49 -49
View File
@@ -10,69 +10,69 @@ class Response implements ResponseInterface
{
use Message;
use Message;
protected int $statusCode = 200;
protected int $statusCode = 200;
protected string $reasonPhrase = '';
protected string $reasonPhrase = '';
/**
* @return int
*/
public function getStatusCode(): int
{
return $this->statusCode;
}
/**
* @return int
*/
public function getStatusCode(): int
{
return $this->statusCode;
}
/**
* @param int $code
* @param string $reasonPhrase
* @return $this|\Protocol\Message\Response
*/
public function withStatus($code, $reasonPhrase = ''): static
{
$this->statusCode = $code;
$this->reasonPhrase = $reasonPhrase;
return $this;
}
/**
* @param int $code
* @param string $reasonPhrase
* @return $this|Response
*/
public function withStatus($code, $reasonPhrase = ''): static
{
$this->statusCode = $code;
$this->reasonPhrase = $reasonPhrase;
return $this;
}
/**
* @return string
*/
public function getReasonPhrase(): string
{
return $this->reasonPhrase;
}
/**
* @return string
*/
public function getReasonPhrase(): string
{
return $this->reasonPhrase;
}
/**
* @return string|null
*/
#[Pure] public function getAccessControlAllowOrigin(): ?string
{
return $this->getHeaderLine('Access-Control-Allow-Origin');
}
/**
* @return string|null
*/
#[Pure] public function getAccessControlAllowOrigin(): ?string
{
return $this->getHeaderLine('Access-Control-Allow-Origin');
}
/**
* @return string|null
*/
#[Pure] public function getAccessControlAllowHeaders(): ?string
{
return $this->getHeaderLine('Access-Control-Allow-Headers');
}
/**
* @return string|null
*/
#[Pure] public function getAccessControlAllowHeaders(): ?string
{
return $this->getHeaderLine('Access-Control-Allow-Headers');
}
/**
* @return string|null
*/
#[Pure] public function getAccessControlRequestMethod(): ?string
{
return $this->getHeaderLine('Access-Control-Request-Method');
}
/**
* @return string|null
*/
#[Pure] public function getAccessControlRequestMethod(): ?string
{
return $this->getHeaderLine('Access-Control-Request-Method');
}
}