Skip to content

Commit 2c59bcf

Browse files
committed
- removes the obsolete typecast
1 parent 849a414 commit 2c59bcf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ServerResponse.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ class ServerResponse implements Response, \JsonSerializable
3535
* @param int $statusCode [optional]
3636
* @param array $headers [optional]
3737
*/
38-
public function __construct(mixed $content = '', int $statusCode = HttpStatus::OK, array $headers = [])
38+
public function __construct(
39+
mixed $content = '',
40+
int $statusCode = HttpStatus::OK,
41+
array $headers = [])
3942
{
4043
$this->setStatus($this, $statusCode);
4144
$this->setHeaders($headers);
@@ -102,7 +105,7 @@ protected function setStatus(ServerResponse $instance, int $statusCode, string $
102105
);
103106
}
104107
$instance->statusCode = (int)$statusCode;
105-
$instance->reasonPhrase = $reasonPhrase ? (string)$reasonPhrase : StatusCode::CODE[$statusCode];
108+
$instance->reasonPhrase = $reasonPhrase ?: HttpStatus::CODE[$statusCode];
106109
return $instance;
107110
}
108111

0 commit comments

Comments
 (0)