function Process::replacePlaceholders
1 call to Process::replacePlaceholders()
- Process::start in vendor/
symfony/ process/ Process.php - Starts the process and returns after writing the input to STDIN.
File
-
vendor/
symfony/ process/ Process.php, line 1656
Class
- Process
- Process is a thin wrapper around proc_* functions to easily start independent PHP processes.
Namespace
Symfony\Component\ProcessCode
private function replacePlaceholders(string $commandline, array $env) : string {
return preg_replace_callback('/"\\$\\{:([_a-zA-Z]++[_a-zA-Z0-9]*+)\\}"/', function ($matches) use ($commandline, $env) {
if (!isset($env[$matches[1]]) || false === $env[$matches[1]]) {
throw new InvalidArgumentException(\sprintf('Command line is missing a value for parameter "%s": ', $matches[1]) . $commandline);
}
return $this->escapeArgument($env[$matches[1]]);
}, $commandline);
}