8000 Remove Process::escapeArgument argument type hint · symfony/symfony@acf8b83 · GitHub
[go: up one dir, main page]

Skip to content

Commit acf8b83

Browse files
vudaltsovnicolas-grekas
authored andcommitted
Remove Process::escapeArgument argument type hint
1 parent 5bd2403 commit acf8b83

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Symfony/Component/Process/Process.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,14 +1530,14 @@ 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(?string $argument): string
15341534
{
1535+
if ('' === $argument || null === $argument) {
1536+
return '""';
1537+
}
15351538
if ('\\' !== \DIRECTORY_SEPARATOR) {
15361539
return "'".str_replace("'", "'\\''", $argument)."'";
15371540
}
1538-
if ('' === $argument = (string) $argument) {
1539-
return '""';
1540-
}
15411541
if (false !== strpos($argument, "\0")) {
15421542
$argument = str_replace("\0", '?', $argument);
15431543
}

0 commit comments

Comments
 (0)
0