Skip to content

Commit

Permalink
Make implicit nullable types explicit (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas authored Mar 21, 2024
1 parent 6d4dcc7 commit 89d7f5d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Body/FormBody.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ final class FormBody implements RequestBody
/**
* @param string $boundary An optional multipart boundary string
*/
public function __construct(string $boundary = null)
public function __construct(?string $boundary = null)
{
/** @noinspection PhpUnhandledExceptionInspection */
$this->boundary = $boundary ?? \bin2hex(\random_bytes(16));
Expand Down
2 changes: 1 addition & 1 deletion src/Connection/Internal/Http1Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function buffer(string $data): void
*
* @throws ParseException
*/
public function parse(string $data = null): ?Response
public function parse(?string $data = null): ?Response
{
if ($data !== null) {
$this->buffer .= $data;
Expand Down
2 changes: 1 addition & 1 deletion src/InvalidRequestException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ final class InvalidRequestException extends HttpException
/** @var Request */
private $request;

public function __construct(Request $request, string $message, int $code = 0, \Throwable $previous = null)
public function __construct(Request $request, string $message, int $code = 0, ?\Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
$this->request = $request;
Expand Down
2 changes: 1 addition & 1 deletion src/ParseException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ final class ParseException extends HttpException
* @param int $code
* @param \Throwable|null $previousException
*/
public function __construct(string $message, int $code, \Throwable $previousException = null)
public function __construct(string $message, int $code, ?\Throwable $previousException = null)
{
parent::__construct($message, $code, $previousException);
}
Expand Down

0 comments on commit 89d7f5d

Please sign in to comment.