Skip to content

Commit 5610dee

Browse files
Merge branch '6.4' into 7.0
* 6.4: (28 commits) [Serializer] Fix `@method` annotation fix compatibility with Doctrine DBAL 4 ensure string type with mbstring func overloading enabled [HttpKernel] Fix quotes expectations in tests [Validator] updated Greek translation [Cache][HttpFoundation][Lock] Fix empty username/password for PDO PostgreSQL [HttpClient][WebProfilerBundle] Do not generate cURL command when files are uploaded render newline in front of all script elements fix test fixture fix tests [Cache] Fix property types in PdoAdapter PHP files cannot be executable without shebang [TwigBridge] Mark CodeExtension as @internal Remove full DSNs from exception messages [Yaml] Fix uid binary parsing Disable the "Copy as cURL" button when the debug info are disabled [HttpClient] Replace `escapeshellarg` to prevent overpassing `ARG_MAX` Fix missing `profile` option for console commands [HttpFoundation][Lock] Makes MongoDB adapters usable with `ext-mongodb` only [HttpKernel] Preventing error 500 when function putenv is disabled ...
2 parents 3411cf9 + a91571f commit 5610dee

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

Messenger/RunProcessContext.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616
/**
1717
* @author Kevin Bond <[email protected]>
1818
*/
19-
final class RunProcessContext extends RunProcessMessage
19+
final class RunProcessContext
2020
{
2121
public readonly ?int $exitCode;
2222
public readonly ?string $output;
2323
public readonly ?string $errorOutput;
2424

25-
public function __construct(RunProcessMessage $message, Process $process)
26-
{
27-
parent::__construct($message->command, $message->cwd, $message->env, $message->input, $message->timeout);
28-
25+
public function __construct(
26+
public readonly RunProcessMessage $message,
27+
Process $process,
28+
) {
2929
$this->exitCode = $process->getExitCode();
3030
$this->output = $process->isOutputDisabled() ? null : $process->getOutput();
3131
$this->errorOutput = $process->isOutputDisabled() ? null : $process->getErrorOutput();

Process.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ class Process implements \IteratorAggregate
7777
private bool $pty;
7878
private array $options = ['suppress_errors' => true, 'bypass_shell' => true];
7979

80-
private bool $useFileHandles;
8180
private WindowsPipes|UnixPipes $processPipes;
8281

8382
private ?int $latestSignal = null;
@@ -163,7 +162,6 @@ public function __construct(array $command, string $cwd = null, array $env = nul
163162

164163
$this->setInput($input);
165164
$this->setTimeout($timeout);
166-
$this->useFileHandles = '\\' === \DIRECTORY_SEPARATOR;
167165
$this->pty = false;
168166
}
169167

@@ -320,7 +318,7 @@ public function start(callable $callback = null, array $env = []): void
320318

321319
if ('\\' === \DIRECTORY_SEPARATOR) {
322320
$commandline = $this->prepareWindowsCommandLine($commandline, $env);
323-
} elseif (!$this->useFileHandles && $this->isSigchildEnabled()) {
321+
} elseif ($this->isSigchildEnabled()) {
324322
// last exit code is output on the fourth pipe and caught to work around --enable-sigchild
325323
$descriptors[3] = ['pipe', 'w'];
326324

Tests/Messenger/RunProcessMessageHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function testRunSuccessfulProcess()
2222
{
2323
$context = (new RunProcessMessageHandler())(new RunProcessMessage(['ls'], cwd: __DIR__));
2424

25-
$this->assertSame(['ls'], $context->command);
25+
$this->assertSame(['ls'], $context->message->command);
2626
$this->assertSame(0, $context->exitCode);
2727
$this->assertStringContainsString(basename(__FILE__), $context->output);
2828
}
@@ -32,7 +32,7 @@ public function testRunFailedProcess()
3232
try {
3333
(new RunProcessMessageHandler())(new RunProcessMessage(['invalid']));
3434
} catch (RunProcessFailedException $e) {
35-
$this->assertSame(['invalid'], $e->context->command);
35+
$this->assertSame(['invalid'], $e->context->message->command);
3636
$this->assertSame('\\' === \DIRECTORY_SEPARATOR ? 1 : 127, $e->context->exitCode);
3737

3838
return;

Tests/OutputMemoryLimitProcess.php

100755100644
File mode changed.

0 commit comments

Comments
 (0)