Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PHP 8.1 #434

Merged
merged 1 commit into from
Dec 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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