function AbstractPhpProcess::getCommand
Returns the command based into the configurations.
Return value
string[]
1 call to AbstractPhpProcess::getCommand()
- DefaultPhpProcess::runProcess in vendor/
phpunit/ phpunit/ src/ Util/ PHP/ DefaultPhpProcess.php - Handles creating the child process and returning the STDOUT and STDERR.
File
-
vendor/
phpunit/ phpunit/ src/ Util/ PHP/ AbstractPhpProcess.php, line 161
Class
- AbstractPhpProcess
- @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Namespace
PHPUnit\Util\PHPCode
public function getCommand(array $settings, ?string $file = null) : array {
$runtime = new Runtime();
$command = [];
$command[] = PHP_BINARY;
if ($runtime->hasPCOV()) {
$settings = array_merge($settings, $runtime->getCurrentSettings(array_keys(ini_get_all('pcov'))));
}
elseif ($runtime->hasXdebug()) {
$settings = array_merge($settings, $runtime->getCurrentSettings(array_keys(ini_get_all('xdebug'))));
}
$command = array_merge($command, $this->settingsToParameters($settings));
if (PHP_SAPI === 'phpdbg') {
$command[] = '-qrr';
if (!$file) {
$command[] = 's=';
}
}
if ($file) {
$command[] = '-f';
$command[] = $file;
}
if ($this->arguments) {
if (!$file) {
$command[] = '--';
}
foreach (explode(' ', $this->arguments) as $arg) {
$command[] = trim($arg);
}
}
return $command;
}