Skip to content

Commit 8a895f0

Browse files
Make PHP 8 green on Travis
1 parent f5104c9 commit 8a895f0

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Pipes/UnixPipes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function readAndWrite($blocking, $close = false)
118118
$read[$type = array_search($pipe, $this->pipes, true)] = '';
119119

120120
do {
121-
$data = fread($pipe, self::CHUNK_SIZE);
121+
$data = @fread($pipe, self::CHUNK_SIZE);
122122
$read[$type] .= $data;
123123
} while (isset($data[0]) && ($close || isset($data[self::CHUNK_SIZE - 1])));
124124

Tests/ProcessTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,16 +987,23 @@ public function provideMethodsThatNeedATerminatedProcess()
987987
*/
988988
public function testWrongSignal($signal)
989989
{
990-
$this->expectException('Symfony\Component\Process\Exception\RuntimeException');
991990
if ('\\' === \DIRECTORY_SEPARATOR) {
992991
$this->markTestSkipped('POSIX signals do not work on Windows');
993992
}
994993

994+
if (\PHP_VERSION_ID < 80000 || \is_int($signal)) {
995+
$this->expectException(RuntimeException::class);
996+
} else {
997+
$this->expectException('TypeError');
998+
}
999+
9951000
$process = $this->getProcessForCode('sleep(38);');
9961001
$process->start();
9971002
try {
9981003
$process->signal($signal);
9991004
$this->fail('A RuntimeException must have been thrown');
1005+
} catch (\TypeError $e) {
1006+
$process->stop(0);
10001007
} catch (RuntimeException $e) {
10011008
$process->stop(0);
10021009
}

0 commit comments

Comments
 (0)