mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-26 04:32:36 +01:00
fix xdebug option
This commit is contained in:
parent
099fdcc05b
commit
46948a4fe7
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Rector\Console;
|
||||
|
||||
use Composer\XdebugHandler\XdebugHandler;
|
||||
use Jean85\PrettyVersions;
|
||||
use Rector\Configuration\Configuration;
|
||||
use Rector\Console\Output\JsonOutputFormatter;
|
||||
@ -55,6 +56,14 @@ final class Application extends SymfonyApplication
|
||||
|
||||
public function doRun(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
// @fixes https://github.com/rectorphp/rector/issues/2205
|
||||
$isXdebugAllowed = $input->hasParameterOption('--xdebug');
|
||||
if (!$isXdebugAllowed) {
|
||||
$xdebug = new XdebugHandler('rector', '--ansi');
|
||||
$xdebug->check();
|
||||
unset($xdebug);
|
||||
}
|
||||
|
||||
$this->configuration->setConfigFilePathFromInput($input);
|
||||
|
||||
$shouldFollowByNewline = false;
|
||||
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Rector\Console\Command;
|
||||
|
||||
use Composer\XdebugHandler\XdebugHandler;
|
||||
use Nette\Utils\Strings;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Descriptor\TextDescriptor;
|
||||
@ -61,12 +60,5 @@ abstract class AbstractCommand extends Command
|
||||
|
||||
$this->getApplication()->setCatchExceptions(false);
|
||||
}
|
||||
|
||||
// @fixes https://github.com/rectorphp/rector/issues/2205
|
||||
if ($input->getOption('xdebug')) {
|
||||
$xdebug = new XdebugHandler('rector', '--ansi');
|
||||
$xdebug->check();
|
||||
unset($xdebug);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user