Skip to content

Commit

Permalink
Merge pull request #434 from clue-labs/php8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
WyriHaximus authored Dec 4, 2021
2 parents 9717566 + aaa6afb commit 9c4815c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
cacheResult="false">
cacheResult="false"
convertDeprecationsToExceptions="true">
<testsuites>
<testsuite name="React Test Suite">
<directory>./tests/</directory>
Expand Down
6 changes: 4 additions & 2 deletions src/Io/RequestHeaderParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function parseRequest($headers, $remoteSocketUri, $localSocketUri)
);

// scheme is `http` unless TLS is used
$localParts = \parse_url($localSocketUri);
$localParts = $localSocketUri === null ? array() : \parse_url($localSocketUri);
if (isset($localParts['scheme']) && $localParts['scheme'] === 'tls') {
$scheme = 'https://';
$serverParams['HTTPS'] = 'on';
Expand Down Expand Up @@ -242,7 +242,9 @@ public function parseRequest($headers, $remoteSocketUri, $localSocketUri)
}

// make sure value does not contain any other URI component
unset($parts['scheme'], $parts['host'], $parts['port']);
if (\is_array($parts)) {
unset($parts['scheme'], $parts['host'], $parts['port']);
}
if ($parts === false || $parts) {
throw new \InvalidArgumentException('Invalid Host header value');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Io/StreamingServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ function ($error) use ($that, $conn, $request) {
$previous = $error;
}

$exception = new \RuntimeException($message, null, $previous);
$exception = new \RuntimeException($message, 0, $previous);

$that->emit('error', array($exception));
return $that->writeError($conn, Response::STATUS_INTERNAL_SERVER_ERROR, $request);
Expand Down
1 change: 0 additions & 1 deletion tests/Io/IniUtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public function provideInvalidInputIniSizeToBytes()
return array(
array('-1G'),
array('0G'),
array(null),
array('foo'),
array('fooK'),
array('1ooL'),
Expand Down

0 comments on commit 9c4815c

Please sign in to comment.