diff --git a/src/OAuth2/Response.php b/src/OAuth2/Response.php index 88c1ad5f..c52109c7 100644 --- a/src/OAuth2/Response.php +++ b/src/OAuth2/Response.php @@ -140,18 +140,18 @@ public function getStatusCode() } /** - * @param int $statusCode - * @param string $text * @throws InvalidArgumentException */ - public function setStatusCode($statusCode, $text = null) + public function setStatusCode(int $statusCode, $text = null): object { - $this->statusCode = (int) $statusCode; + $this->statusCode = $statusCode; if ($this->isInvalid()) { throw new InvalidArgumentException(sprintf('The HTTP status code "%s" is not valid.', $statusCode)); } $this->statusText = false === $text ? '' : (null === $text ? self::$statusTexts[$this->statusCode] : $text); + + return $this; } /** diff --git a/src/OAuth2/ResponseInterface.php b/src/OAuth2/ResponseInterface.php index efc6c86a..de48c640 100644 --- a/src/OAuth2/ResponseInterface.php +++ b/src/OAuth2/ResponseInterface.php @@ -10,19 +10,10 @@ */ interface ResponseInterface { - /** - * @param array $parameters - */ public function addParameters(array $parameters); - /** - * @param array $httpHeaders - */ public function addHttpHeaders(array $httpHeaders); - /** - * @param int $statusCode - */ public function setStatusCode(int $statusCode): object; /**