Skip to content

Commit 58357d5

Browse files
minor #447 Use ProcessExecutor::escape() (nicolas-grekas)
This PR was merged into the 1.1-dev branch. Discussion ---------- Use ProcessExecutor::escape() per https://github.com/symfony/flex/pull/446/files#r240585349 Commits ------- c913545 Use ProcessExecutor::escape()
2 parents 122945f + c913545 commit 58357d5

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
},
1616
"require-dev": {
1717
"composer/composer": "^1.0.2",
18-
"symfony/phpunit-bridge": "^3.4.19|^4.1.8",
19-
"symfony/process": "^2.8"
18+
"symfony/phpunit-bridge": "^3.4.19|^4.1.8"
2019
},
2120
"autoload": {
2221
"psr-4": {

src/ScriptExecutor.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use Symfony\Component\Console\Output\OutputInterface;
2020
use Symfony\Component\Console\Output\StreamOutput;
2121
use Symfony\Component\Process\PhpExecutableFinder;
22-
use Symfony\Component\Process\ProcessUtils;
2322

2423
/**
2524
* @author Fabien Potencier <[email protected]>
@@ -100,7 +99,7 @@ private function expandSymfonyCmd(string $cmd)
10099
return null;
101100
}
102101

103-
$console = ProcessUtils::escapeArgument($this->options->get('bin-dir').'/console');
102+
$console = ProcessExecutor::escape($this->options->get('bin-dir').'/console');
104103
if ($this->io->isDecorated()) {
105104
$console .= ' --ansi';
106105
}
@@ -128,8 +127,8 @@ private function expandPhpScript(string $cmd): string
128127
$arguments[] = '--php-ini='.$ini;
129128
}
130129

131-
$phpArgs = implode(' ', array_map([ProcessUtils::class, 'escapeArgument'], $arguments));
130+
$phpArgs = implode(' ', array_map([ProcessExecutor::class, 'escape'], $arguments));
132131

133-
return ProcessUtils::escapeArgument($php).($phpArgs ? ' '.$phpArgs : '').' '.$cmd;
132+
return ProcessExecutor::escape($php).($phpArgs ? ' '.$phpArgs : '').' '.$cmd;
134133
}
135134
}

0 commit comments

Comments
 (0)