Skip to content

Commit d8e7569

Browse files
committed
Improve PHP 8.4+ support by avoiding implicitly nullable types
1 parent a2c4576 commit d8e7569

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ on:
77
jobs:
88
PHPUnit:
99
name: PHPUnit (PHP ${{ matrix.php }})
10-
runs-on: ubuntu-24.04
10+
runs-on: ubuntu-22.04
1111
strategy:
1212
matrix:
1313
php:
14-
- 8.4
1514
- 8.3
1615
- 8.2
1716
- 8.1
@@ -39,7 +38,7 @@ jobs:
3938

4039
PHPUnit-hhvm:
4140
name: PHPUnit (HHVM)
42-
runs-on: ubuntu-24.04
41+
runs-on: ubuntu-22.04
4342
continue-on-error: true
4443
steps:
4544
- uses: actions/checkout@v4

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
},
2323
"require": {
2424
"php": ">=5.3",
25-
"clue/multicast-react": "1.x-dev#f1bd5df0309b9f8b3486b09bf37aedfb042addb6",
25+
"clue/multicast-react": "^1.0 || ^0.2",
2626
"react/event-loop": "^1.2",
27-
"react/promise": "^3.2 || ^2.7 || ^1.2.1"
27+
"react/promise": "^2.0 || ^1.0"
2828
},
2929
"require-dev": {
3030
"phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36"

src/Client.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,11 @@ public function search($searchTarget = 'ssdp:all', $mx = 2)
6161
throw new RuntimeException('Cancelled');
6262
});
6363

64-
$timer = $this->loop->addTimer($mx, function() use ($socket, &$deferred, &$messages) {
65-
$deferred->resolve($messages);
66-
$socket->close();
67-
});
68-
6964
$that = $this;
70-
$socket->on('message', function ($data, $remote) use (&$messages, $that) {
65+
$socket->on('message', function ($data, $remote) use ($deferred, $that) {
7166
$message = $that->parseMessage($data, $remote);
72-
$messages[] = $message;
67+
68+
$deferred->progress($message);
7369
});
7470

7571
$socket->send($data, self::ADDRESS);

0 commit comments

Comments
 (0)