8000 minor #52399 Remove unused code from Process (ausi) · symfony/symfony@d7c5c47 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit d7c5c47

Browse files
minor #52399 Remove unused code from Process (ausi)
This PR was submitted for the 6.3 branch but it was merged into the 6.4 branch instead. Discussion ---------- Remove unused code from Process | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | - | License | MIT While trying to work on #43162 (comment) I noticed that the private member `useFileHandles` is not used for anything anymore. It is always set in the constructor to `'\\' === \DIRECTORY_SEPARATOR` so it basically has a constant value and its only usage is in an `elseif` after a check to the very same constant value: `if ('\\' === \DIRECTORY_SEPARATOR)`. Therefore this code does nothing and can be removed. Commits ------- 7a5eba2 [Process] Remove dead code from Process
2 parents 10209f5 + 7a5eba2 commit d7c5c47

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Symfony/Component/Process/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

@@ -325,7 +323,7 @@ public function start(callable $callback = null, array $env = [])
325323

326324
if ('\\' === \DIRECTORY_SEPARATOR) {
327325
$commandline = $this->prepareWindowsCommandLine($commandline, $env);
328-
} elseif (!$this->useFileHandles && $this->isSigchildEnabled()) {
326+
} elseif ($this->isSigchildEnabled()) {
329327
// last exit code is output on the fourth pipe and caught to work around --enable-sigchild
330328
$descriptors[3] = ['pipe', 'w'];
331329

0 commit comments

Comments
 (0)
0