From 4f1cc44c2ace7bd98f0db6bc651e580a57f63802 Mon Sep 17 00:00:00 2001 From: TomasVotruba Date: Mon, 25 Dec 2017 19:20:41 +0100 Subject: [PATCH] ProgressBar: fix verbosity fuction --- bin/rector.php | 10 ++++++++-- src/DependencyInjection/AppKernel.php | 2 +- src/config/external-services.yml | 10 +++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/bin/rector.php b/bin/rector.php index f630521e874..1ffc7c248f1 100644 --- a/bin/rector.php +++ b/bin/rector.php @@ -4,6 +4,8 @@ use Rector\Configuration\RectorConfigFilePathHelper; use Rector\Console\Application; use Rector\DependencyInjection\ContainerFactory; use Symfony\Component\Console\Input\ArgvInput; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; use Symplify\PackageBuilder\Configuration\ConfigFilePathHelper; use Symplify\PackageBuilder\Console\Style\SymfonyStyleFactory; @@ -34,7 +36,11 @@ try { // 3. Run Console Application /** @var Application $application */ $application = $container->get(Application::class); - $statusCode = $application->run(); + /** @var InputInterface $input */ + $input = $container->get(InputInterface::class); + /** @var OutputInterface $output */ + $output = $container->get(OutputInterface::class); + $statusCode = $application->run($input, $output); exit($statusCode); } catch (Throwable $throwable) { $symfonyStyle = SymfonyStyleFactory::create(); @@ -44,5 +50,5 @@ try { $throwable->getFile(), $throwable->getLine() )); - exit(1); + exit($throwable->getCode()); } diff --git a/src/DependencyInjection/AppKernel.php b/src/DependencyInjection/AppKernel.php index cec598c5370..e7b19975d82 100644 --- a/src/DependencyInjection/AppKernel.php +++ b/src/DependencyInjection/AppKernel.php @@ -23,7 +23,7 @@ final class AppKernel extends Kernel $this->configFile = $configFile; } - parent::__construct('dev' . sha1($configFile), true); + parent::__construct('cli' . sha1($configFile), false); } public function registerContainerConfiguration(LoaderInterface $loader): void diff --git a/src/config/external-services.yml b/src/config/external-services.yml index b4b020ade25..86f24de0c10 100644 --- a/src/config/external-services.yml +++ b/src/config/external-services.yml @@ -24,6 +24,14 @@ services: Symfony\Component\Console\Style\SymfonyStyle: factory: ['Symplify\PackageBuilder\Console\Style\SymfonyStyleFactory', 'create'] + Symfony\Component\Console\Input\ArgvInput: ~ + Symfony\Component\Console\Input\InputInterface: + alias: Symfony\Component\Console\Input\ArgvInput + + Symfony\Component\Console\Output\ConsoleOutput: ~ + Symfony\Component\Console\Output\OutputInterface: + alias: Symfony\Component\Console\Output\ConsoleOutput + Symplify\PackageBuilder\Parameter\ParameterProvider: ~ - PhpCsFixer\Differ\UnifiedDiffer: ~ \ No newline at end of file +# PhpCsFixer\Differ\UnifiedDiffer: ~