Skip to content

Commit

Permalink
Prevent type issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
terrylinooo committed Jul 25, 2020
1 parent 83af410 commit 729d22d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Psr17/UriFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static function fromGlobal(): UriInterface
if ($query) {
$uri .= '?' . $query;
}

return new Uri($uri);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Psr7/ServerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ protected function determineParsedBody(array $postParams)
// Is it a form submit or not.
$isForm = false;

if ($httpMethod === 'POST' && !empty($postParams)) {
if ($httpMethod === 'POST') {

// If the request Content-Type is either application/x-www-form-urlencoded
// or multipart/form-data, and the request method is POST, this method MUST
Expand All @@ -342,7 +342,7 @@ protected function determineParsedBody(array $postParams)
];

if (in_array($contentType, $postRequiredContentTypes)) {
$this->parsedBody = $postParams ?: null;
$this->parsedBody = $postParams ?? null;
$isForm = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Psr7/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class Uri implements UriInterface
public function __construct($uri = '')
{
$this->assertString($uri, 'uri');
$this->init(parse_url($uri));
$this->init((array) parse_url($uri));
}

/**
Expand Down

0 comments on commit 729d22d

Please sign in to comment.