Skip to content

Commit

Permalink
Support PHP 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed Dec 6, 2021
1 parent 1d925c7 commit 2e19efd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"react/cache": "^1.0 || ^0.6 || ^0.5",
"react/event-loop": "^1.2",
"react/promise": "^3.0 || ^2.7 || ^1.2.1",
"react/promise-timer": "^1.2"
"react/promise-timer": "^1.8"
},
"require-dev": {
"clue/block-react": "^1.2",
Expand Down
3 changes: 2 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheResult="false"
colors="true"
cacheResult="false">
convertDeprecationsToExceptions="true">
<testsuites>
<testsuite name="React Test Suite">
<directory>./tests/</directory>
Expand Down
4 changes: 2 additions & 2 deletions src/Config/HostsFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ public function getHostsForIp($ip)

$names = array();
foreach (preg_split('/\r?\n/', $this->contents) as $line) {
$parts = preg_split('/\s+/', $line, null, PREG_SPLIT_NO_EMPTY);
$addr = array_shift($parts);
$parts = preg_split('/\s+/', $line, -1, PREG_SPLIT_NO_EMPTY);
$addr = (string) array_shift($parts);

// remove IPv6 zone ID (`fe80::1%lo0` => `fe80:1`)
if (strpos($addr, ':') !== false && ($pos = strpos($addr, '%')) !== false) {
Expand Down
2 changes: 1 addition & 1 deletion src/Protocol/BinaryDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private function recordsToBinary(array $records)
if ($opt === Message::OPT_TCP_KEEPALIVE && $value !== null) {
$value = \pack('n', round($value * 10));
}
$binary .= \pack('n*', $opt, \strlen($value)) . $value;
$binary .= \pack('n*', $opt, \strlen((string) $value)) . $value;
}
break;
default:
Expand Down

0 comments on commit 2e19efd

Please sign in to comment.