Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused code from Process #52399

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/Symfony/Component/Process/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ class Process implements \IteratorAggregate
private bool $pty;
private array $options = ['suppress_errors' => true, 'bypass_shell' => true];

private bool $useFileHandles;
private WindowsPipes|UnixPipes $processPipes;

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

$this->setInput($input);
$this->setTimeout($timeout);
$this->useFileHandles = '\\' === \DIRECTORY_SEPARATOR;
$this->pty = false;
}

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

if ('\\' === \DIRECTORY_SEPARATOR) {
$commandline = $this->prepareWindowsCommandLine($commandline, $env);
} elseif (!$this->useFileHandles && $this->isSigchildEnabled()) {
} elseif ($this->isSigchildEnabled()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} elseif ($this->isSigchildEnabled()) {
} elseif ('\\' !== \DIRECTORY_SEPARATOR && $this->isSigchildEnabled()) {

Copy link
Contributor

@chapterjason chapterjason Nov 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The elseif will only be considered if if ('\\' === \DIRECTORY_SEPARATOR) (2 lines before) doesn't hit. Basically it will be checked twice but vice versa, as suggested change. 🤔

// last exit code is output on the fourth pipe and caught to work around --enable-sigchild
$descriptors[3] = ['pipe', 'w'];

Expand Down
Loading