Skip to content
This repository has been archived by the owner on Nov 2, 2022. It is now read-only.

Commit

Permalink
Adapted setStatusCode() signature
Browse files Browse the repository at this point in the history
  • Loading branch information
Holger Banse committed May 26, 2021
1 parent 7ca6835 commit a15f0d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/OAuth2/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
9 changes: 0 additions & 9 deletions src/OAuth2/ResponseInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down

0 comments on commit a15f0d7

Please sign in to comment.