Skip to content

Commit ded5cbd

Browse files
authored
Merge pull request #115 from 6b7562617765726c6f73/php85
[0.7.x] Improve PHP 8.5+ support by replacing binary cast with string cast
2 parents dfc3fe9 + fe5afab commit ded5cbd

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
- ubuntu-24.04
1515
- windows-2022
1616
php:
17+
- 8.5
1718
- 8.4
1819
- 8.3
1920
- 8.2

src/Process.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function __construct($cmd, $cwd = null, $env = null, $fds = null)
121121
if (null !== $env) {
122122
$this->env = array();
123123
foreach ($env as $key => $value) {
124-
$this->env[(binary) $key] = (binary) $value;
124+
$this->env[(string) $key] = (string) $value;
125125
}
126126
}
127127

tests/AbstractProcessTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ public function testStartWithoutLoopAssignsLoopAutomatically()
7070
$process->start();
7171

7272
$ref = new \ReflectionProperty($process->stdin, 'loop');
73-
$ref->setAccessible(true);
73+
if (PHP_VERSION_ID < 80100) {
74+
$ref->setAccessible(true);
75+
}
7476
$loop = $ref->getValue($process->stdin);
7577

7678
$this->assertInstanceOf('React\EventLoop\LoopInterface', $loop);
@@ -515,7 +517,7 @@ public function testProcessWithDefaultCwdAndEnv()
515517
* environment variable (i.e. current shell/script) on some platforms.
516518
*/
517519
$this->assertSame(getcwd(), $cwd);
518-
$this->assertLessThanOrEqual(1, (count($_SERVER) - (integer) $envCount));
520+
$this->assertLessThanOrEqual(1, (count($_SERVER) - (int) $envCount));
519521
}
520522

521523
public function testProcessWithCwd()

0 commit comments

Comments
 (0)