Skip to content

Commit 74e4943

Browse files
committed
remove condition check is integer setStatusCode param $code
1 parent 66eae1b commit 74e4943

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Response.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ class Response implements PhpRestfulApiResponse
113113
*/
114114
private $statusCode;
115115

116+
/**
117+
* Response constructor.
118+
* @param string $body
119+
* @param int $status
120+
* @param array $headers
121+
*/
116122
public function __construct($body = 'php://memory', $status = 200, array $headers = [])
117123
{
118124
$this->setStatusCode($status);
@@ -366,9 +372,7 @@ public function errorUnprocessable(string $message = '', array $headers = [])
366372
*/
367373
private function setStatusCode(int $code)
368374
{
369-
if (! is_numeric($code)
370-
|| is_float($code)
371-
|| $code < static::MIN_STATUS_CODE_VALUE
375+
if ($code < static::MIN_STATUS_CODE_VALUE
372376
|| $code > static::MAX_STATUS_CODE_VALUE
373377
) {
374378
throw new InvalidArgumentException(sprintf(

0 commit comments

Comments
 (0)