Skip to content

Commit 074dc6b

Browse files
committed
Run tests on PHP 8.4 and update test environment
1 parent da2e173 commit 074dc6b

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ on:
77
jobs:
88
PHPUnit:
99
name: PHPUnit (PHP ${{ matrix.php }})
10-
runs-on: ubuntu-22.04
10+
runs-on: ubuntu-24.04
1111
strategy:
1212
matrix:
1313
php:
14+
- 8.4
1415
- 8.3
1516
- 8.2
1617
- 8.1
@@ -31,14 +32,16 @@ jobs:
3132
php-version: ${{ matrix.php }}
3233
coverage: xdebug
3334
- run: composer install
35+
- run: vendor/bin/phpunit --coverage-text --no-deprecations
36+
if: ${{ matrix.php == '8.4' }}
3437
- run: vendor/bin/phpunit --coverage-text
35-
if: ${{ matrix.php >= 7.3 }}
38+
if: ${{ matrix.php >= 7.3 && matrix.php != '8.4' }}
3639
- run: vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy
3740
if: ${{ matrix.php < 7.3 }}
3841

3942
PHPUnit-hhvm:
4043
name: PHPUnit (HHVM)
41-
runs-on: ubuntu-22.04
44+
runs-on: ubuntu-24.04
4245
continue-on-error: true
4346
steps:
4447
- uses: actions/checkout@v4

src/Client.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Client
2828
* @param ?LoopInterface $loop
2929
* @param ?MulticastFactory $multicast
3030
*/
31-
public function __construct(LoopInterface $loop = null, MulticastFactory $multicast = null)
31+
public function __construct(?LoopInterface $loop = null, ?MulticastFactory $multicast = null)
3232
{
3333
$this->loop = $loop ?: Loop::get();
3434
$this->multicast = $multicast ?: new MulticastFactory($this->loop);
@@ -46,11 +46,6 @@ public function search($searchTarget = 'ssdp:all', $mx = 2)
4646
$socket = $this->multicast->createSender();
4747
// TODO: The TTL for the IP packet SHOULD default to 2 and SHOULD be configurable.
4848

49-
$timer = $this->loop->addTimer($mx, function() use ($socket, &$deferred) {
50-
$deferred->resolve();
51-
$socket->close();
52-
});
53-
5449
$loop = $this->loop;
5550
$deferred = new Deferred(function () use ($socket, &$timer, $loop) {
5651
// canceling resulting promise cancels timer and closes socket
@@ -59,6 +54,11 @@ public function search($searchTarget = 'ssdp:all', $mx = 2)
5954
throw new RuntimeException('Cancelled');
6055
});
6156

57+
$timer = $this->loop->addTimer($mx, function() use ($socket, $deferred) {
58+
$deferred->resolve();
59+
$socket->close();
60+
});
61+
6262
$that = $this;
6363
$socket->on('message', function ($data, $remote) use ($deferred, $that) {
6464
$message = $that->parseMessage($data, $remote);

0 commit comments

Comments
 (0)