1
0
Fork 0

Remove obsolete Symfony feature detections (#10425)

pull/10428/head
Alexander M. Turek 2022-01-04 10:41:33 +01:00 committed by GitHub
parent 1c928466a9
commit 36da81bec2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 30 deletions

View File

@ -97,7 +97,7 @@ class ConsoleIO extends BaseIO
*/
public function isVerbose()
{
return $this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE;
return $this->output->isVerbose();
}
/**
@ -105,7 +105,7 @@ class ConsoleIO extends BaseIO
*/
public function isVeryVerbose()
{
return $this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE;
return $this->output->isVeryVerbose();
}
/**
@ -113,7 +113,7 @@ class ConsoleIO extends BaseIO
*/
public function isDebug()
{
return $this->output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG;
return $this->output->isDebug();
}
/**

View File

@ -118,13 +118,7 @@ class ProcessExecutor
$this->captureOutput = func_num_args() > 3;
$this->errorOutput = '';
// TODO in v3, commands should be passed in as arrays of cmd + args
if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) {
$process = Process::fromShellCommandline($command, $cwd, null, null, static::getTimeout());
} else {
/** @phpstan-ignore-next-line */
$process = new Process($command, $cwd, null, null, static::getTimeout());
}
if (!Platform::isWindows() && $tty) {
try {
$process->setTty(true);
@ -249,12 +243,7 @@ class ProcessExecutor
}
try {
// TODO in v3, commands should be passed in as arrays of cmd + args
if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) {
$process = Process::fromShellCommandline($command, $cwd, null, null, static::getTimeout());
} else {
$process = new Process($command, $cwd, null, null, static::getTimeout());
}
} catch (\Throwable $e) {
call_user_func($job['reject'], $e);

View File

@ -281,12 +281,7 @@ class ArchivableFilesFinderTest extends TestCase
*/
protected function getArchivedFiles($command)
{
if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) {
$process = Process::fromShellCommandline($command, $this->sources);
} else {
// @phpstan-ignore-next-line symfony/process 2.8 accepts a string but not 5.3 which is used only for PHPStan
$process = new Process($command, $this->sources);
}
$process->run();
$archive = new \PharData($this->sources.'/archive.zip');

View File

@ -134,16 +134,10 @@ class StrictConfirmationQuestionTest extends TestCase
*/
protected function createInput($entry)
{
$stream = $this->getInputStream($entry);
$input = new ArrayInput(array('--no-interaction'));
$dialog = new QuestionHelper();
$input->setStream($this->getInputStream($entry));
if (method_exists($dialog, 'setInputStream')) {
$dialog->setInputStream($stream);
}
if ($input instanceof StreamableInputInterface) {
$input->setStream($stream);
}
$dialog = new QuestionHelper();
return array($input, $dialog);
}