diff --git a/phpunit.xml.dist b/phpunit.xml.dist index fa88e7e0..fd6a9234 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -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"> ./tests/ diff --git a/src/Io/RequestHeaderParser.php b/src/Io/RequestHeaderParser.php index 743c006c..e5554c46 100644 --- a/src/Io/RequestHeaderParser.php +++ b/src/Io/RequestHeaderParser.php @@ -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'; @@ -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'); } diff --git a/src/Io/StreamingServer.php b/src/Io/StreamingServer.php index dd4c0584..7818f0bd 100644 --- a/src/Io/StreamingServer.php +++ b/src/Io/StreamingServer.php @@ -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); diff --git a/tests/Io/IniUtilTest.php b/tests/Io/IniUtilTest.php index 22374eb4..155c6ed2 100644 --- a/tests/Io/IniUtilTest.php +++ b/tests/Io/IniUtilTest.php @@ -63,7 +63,6 @@ public function provideInvalidInputIniSizeToBytes() return array( array('-1G'), array('0G'), - array(null), array('foo'), array('fooK'), array('1ooL'),