Skip to content

Commit e0d623c

Browse files
nicolas-grekasfabpot
authored andcommitted
Bump minimum version of PHP to 8.1
1 parent d5aec60 commit e0d623c

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

Pipes/UnixPipes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function readAndWrite(bool $blocking, bool $close = false): array
109109
unset($r[0]);
110110

111111
// let's have a look if something changed in streams
112-
set_error_handler([$this, 'handleError']);
112+
set_error_handler($this->handleError(...));
113113
if (($r || $w) && false === stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) {
114114
restore_error_handler();
115115
// if a system call has been interrupted, forget about it, let's try again

Process.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ public function start(callable $callback = null, array $env = [])
308308
$env += '\\' === \DIRECTORY_SEPARATOR ? array_diff_ukey($this->getDefaultEnv(), $env, 'strcasecmp') : $this->getDefaultEnv();
309309

310310
if (\is_array($commandline = $this->commandline)) {
311-
$commandline = implode(' ', array_map([$this, 'escapeArgument'], $commandline));
311+
$commandline = implode(' ', array_map($this->escapeArgument(...), $commandline));
312312

313313
if ('\\' !== \DIRECTORY_SEPARATOR) {
314314
// exec is mandatory to deal with sending a signal to the process
@@ -946,7 +946,7 @@ public function getLastOutputTime(): ?float
946946
*/
947947
public function getCommandLine(): string
948948
{
949-
return \is_array($this->commandline) ? implode(' ', array_map([$this, 'escapeArgument'], $this->commandline)) : $this->commandline;
949+
return \is_array($this->commandline) ? implode(' ', array_map($this->escapeArgument(...), $this->commandline)) : $this->commandline;
950950
}
951951

952952
/**

Tests/ProcessTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ public function testAllOutputIsActuallyReadOnTermination()
176176

177177
// Don't call Process::run nor Process::wait to avoid any read of pipes
178178
$h = new \ReflectionProperty($p, 'process');
179-
$h->setAccessible(true);
180179
$h = $h->getValue($p);
181180
$s = @proc_get_status($h);
182181

@@ -568,7 +567,6 @@ public function testExitCodeText()
568567
$process = $this->getProcess('');
569568
$r = new \ReflectionObject($process);
570569
$p = $r->getProperty('exitcode');
571-
$p->setAccessible(true);
572570

573571
$p->setValue($process, 2);
574572
$this->assertEquals('Misuse of shell builtins', $process->getExitCodeText());

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": ">=8.0.2"
19+
"php": ">=8.1"
2020
},
2121
"autoload": {
2222
"psr-4": { "Symfony\\Component\\Process\\": "" },

0 commit comments

Comments
 (0)