From a15f0d749ea5c3d3f9102da7964518ad3e76c4f4 Mon Sep 17 00:00:00 2001 From: Holger Banse Date: Wed, 26 May 2021 11:07:46 +0200 Subject: [PATCH] Adapted setStatusCode() signature --- src/OAuth2/Response.php | 8 ++++---- src/OAuth2/ResponseInterface.php | 9 --------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/OAuth2/Response.php b/src/OAuth2/Response.php index 88c1ad5f7..c52109c72 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 efc6c86a0..de48c6409 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; /**