Skip to content

Commit 9c4815c

Browse files
authored
Merge pull request #434 from clue-labs/php8.1
2 parents 9717566 + aaa6afb commit 9c4815c

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

phpunit.xml.dist

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
66
bootstrap="vendor/autoload.php"
77
colors="true"
8-
cacheResult="false">
8+
cacheResult="false"
9+
convertDeprecationsToExceptions="true">
910
<testsuites>
1011
<testsuite name="React Test Suite">
1112
<directory>./tests/</directory>

src/Io/RequestHeaderParser.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function parseRequest($headers, $remoteSocketUri, $localSocketUri)
160160
);
161161

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

244244
// make sure value does not contain any other URI component
245-
unset($parts['scheme'], $parts['host'], $parts['port']);
245+
if (\is_array($parts)) {
246+
unset($parts['scheme'], $parts['host'], $parts['port']);
247+
}
246248
if ($parts === false || $parts) {
247249
throw new \InvalidArgumentException('Invalid Host header value');
248250
}

src/Io/StreamingServer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ function ($error) use ($that, $conn, $request) {
196196
$previous = $error;
197197
}
198198

199-
$exception = new \RuntimeException($message, null, $previous);
199+
$exception = new \RuntimeException($message, 0, $previous);
200200

201201
$that->emit('error', array($exception));
202202
return $that->writeError($conn, Response::STATUS_INTERNAL_SERVER_ERROR, $request);

tests/Io/IniUtilTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public function provideInvalidInputIniSizeToBytes()
6363
return array(
6464
array('-1G'),
6565
array('0G'),
66-
array(null),
6766
array('foo'),
6867
array('fooK'),
6968
array('1ooL'),

0 commit comments

Comments
 (0)