Skip to content

Commit 28b107d

Browse files
authored
Merge pull request #67 from clue-labs/php8.5
Improve PHP 8.5+ support by avoiding deprecated `setAccessible()` calls
2 parents 7ad8a28 + 99ec60d commit 28b107d

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
strategy:
1212
matrix:
1313
php:
14+
- 8.5
1415
- 8.4
1516
- 8.3
1617
- 8.2
@@ -26,7 +27,7 @@ jobs:
2627
- 5.4
2728
- 5.3
2829
steps:
29-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@v6
3031
- uses: shivammathur/setup-php@v2
3132
with:
3233
php-version: ${{ matrix.php }}
@@ -39,7 +40,7 @@ jobs:
3940
runs-on: ubuntu-24.04
4041
continue-on-error: true
4142
steps:
42-
- uses: actions/checkout@v4
43+
- uses: actions/checkout@v6
4344
- run: cp "$(which composer)" composer.phar && ./composer.phar self-update --2.2 # downgrade Composer for HHVM
4445
- name: Run hhvm composer.phar install
4546
uses: docker://hhvm/hhvm:3.30-lts-latest

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
],
1313
"require": {
1414
"php": ">=5.3",
15-
"react/promise": "^3.2 || ^2.1 || ^1.2.1",
16-
"react/socket": "^1.16",
15+
"react/promise": "^3.3 || ^2.1 || ^1.2.1",
16+
"react/socket": "^1.17",
1717
"ringcentral/psr7": "^1.2"
1818
},
1919
"require-dev": {
2020
"phpunit/phpunit": "^9.6 || ^8.5 || ^5.7 || ^4.8.36",
2121
"react/async": "^4.3 || ^3 || ^2",
22-
"react/event-loop": "^1.2",
22+
"react/event-loop": "^1.6",
2323
"react/http": "^1.11",
2424
"react/promise-timer": "^1.11"
2525
},

src/ProxyConnector.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ public function connect($uri)
261261
// avoid garbage references by replacing all closures in call stack.
262262
// what a lovely piece of code!
263263
$r = new \ReflectionProperty('Exception', 'trace');
264-
$r->setAccessible(true);
264+
if (PHP_VERSION_ID < 80100) {
265+
$r->setAccessible(true);
266+
}
265267
$trace = $r->getValue($e);
266268

267269
// Exception trace arguments are not available on some PHP 7.4 installs

tests/ProxyConnectorTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ public function testConstructWithoutConnectorAssignsConnectorAutomatically()
2424
$proxy = new ProxyConnector('proxy.example.com');
2525

2626
$ref = new \ReflectionProperty($proxy, 'connector');
27-
$ref->setAccessible(true);
27+
if (PHP_VERSION_ID < 80100) {
28+
$ref->setAccessible(true);
29+
}
2830
$connector = $ref->getValue($proxy);
2931

3032
$this->assertInstanceOf('React\Socket\ConnectorInterface', $connector);

0 commit comments

Comments
 (0)