Remove obsolete Symfony feature detections (#10425)
parent
1c928466a9
commit
36da81bec2
|
@ -97,7 +97,7 @@ class ConsoleIO extends BaseIO
|
||||||
*/
|
*/
|
||||||
public function isVerbose()
|
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()
|
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()
|
public function isDebug()
|
||||||
{
|
{
|
||||||
return $this->output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG;
|
return $this->output->isDebug();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -118,13 +118,7 @@ class ProcessExecutor
|
||||||
$this->captureOutput = func_num_args() > 3;
|
$this->captureOutput = func_num_args() > 3;
|
||||||
$this->errorOutput = '';
|
$this->errorOutput = '';
|
||||||
|
|
||||||
// TODO in v3, commands should be passed in as arrays of cmd + args
|
$process = Process::fromShellCommandline($command, $cwd, null, null, static::getTimeout());
|
||||||
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) {
|
if (!Platform::isWindows() && $tty) {
|
||||||
try {
|
try {
|
||||||
$process->setTty(true);
|
$process->setTty(true);
|
||||||
|
@ -249,12 +243,7 @@ class ProcessExecutor
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// TODO in v3, commands should be passed in as arrays of cmd + args
|
$process = Process::fromShellCommandline($command, $cwd, null, null, static::getTimeout());
|
||||||
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) {
|
} catch (\Throwable $e) {
|
||||||
call_user_func($job['reject'], $e);
|
call_user_func($job['reject'], $e);
|
||||||
|
|
||||||
|
|
|
@ -281,12 +281,7 @@ class ArchivableFilesFinderTest extends TestCase
|
||||||
*/
|
*/
|
||||||
protected function getArchivedFiles($command)
|
protected function getArchivedFiles($command)
|
||||||
{
|
{
|
||||||
if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) {
|
$process = Process::fromShellCommandline($command, $this->sources);
|
||||||
$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();
|
$process->run();
|
||||||
|
|
||||||
$archive = new \PharData($this->sources.'/archive.zip');
|
$archive = new \PharData($this->sources.'/archive.zip');
|
||||||
|
|
|
@ -134,16 +134,10 @@ class StrictConfirmationQuestionTest extends TestCase
|
||||||
*/
|
*/
|
||||||
protected function createInput($entry)
|
protected function createInput($entry)
|
||||||
{
|
{
|
||||||
$stream = $this->getInputStream($entry);
|
|
||||||
$input = new ArrayInput(array('--no-interaction'));
|
$input = new ArrayInput(array('--no-interaction'));
|
||||||
$dialog = new QuestionHelper();
|
$input->setStream($this->getInputStream($entry));
|
||||||
|
|
||||||
if (method_exists($dialog, 'setInputStream')) {
|
$dialog = new QuestionHelper();
|
||||||
$dialog->setInputStream($stream);
|
|
||||||
}
|
|
||||||
if ($input instanceof StreamableInputInterface) {
|
|
||||||
$input->setStream($stream);
|
|
||||||
}
|
|
||||||
|
|
||||||
return array($input, $dialog);
|
return array($input, $dialog);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue