Skip to content

Commit 01f4f0b

Browse files
committed
Remove Process::escapeArgument argument type hint
1 parent 7e0a369 commit 01f4f0b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Symfony/Component/Process/Process.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,14 +1530,15 @@ private function requireProcessIsTerminated(string $functionName)
15301530
/**
15311531
* Escapes a string to be used as a shell argument.
15321532
*/
1533-
private function escapeArgument(string $argument): string
1533+
private function escapeArgument($argument): string
15341534
{
1535+
$argument = (string) $argument;
1536+
if ('' === $argument) {
1537+
return '""';
1538+
}
15351539
if ('\\' !== \DIRECTORY_SEPARATOR) {
15361540
return "'".str_replace("'", "'\\''", $argument)."'";
15371541
}
1538-
if ('' === $argument = (string) $argument) {
1539-
return '""';
1540-
}
15411542
if (false !== strpos($argument, "\0")) {
15421543
$argument = str_replace("\0", '?', $argument);
15431544
}

0 commit comments

Comments
 (0)