Skip to content

Commit 1923ada

Browse files
committed
Support PHP 8.1
1 parent 1d925c7 commit 1923ada

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"react/cache": "^1.0 || ^0.6 || ^0.5",
3131
"react/event-loop": "^1.2",
3232
"react/promise": "^3.0 || ^2.7 || ^1.2.1",
33-
"react/promise-timer": "^1.2"
33+
"react/promise-timer": "^1.8"
3434
},
3535
"require-dev": {
3636
"clue/block-react": "^1.2",

phpunit.xml.dist

Lines changed: 2 additions & 1 deletion
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/Config/HostsFile.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ public function getHostsForIp($ip)
133133

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

139139
// remove IPv6 zone ID (`fe80::1%lo0` => `fe80:1`)
140140
if (strpos($addr, ':') !== false && ($pos = strpos($addr, '%')) !== false) {

src/Protocol/BinaryDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ private function recordsToBinary(array $records)
146146
if ($opt === Message::OPT_TCP_KEEPALIVE && $value !== null) {
147147
$value = \pack('n', round($value * 10));
148148
}
149-
$binary .= \pack('n*', $opt, \strlen($value)) . $value;
149+
$binary .= \pack('n*', $opt, \strlen((string) $value)) . $value;
150150
}
151151
break;
152152
default:

0 commit comments

Comments
 (0)