Skip to content

Commit

Permalink
[FrameworkBundle][ContainerLintCommand] Style messages
Browse files Browse the repository at this point in the history
  • Loading branch information
fancyweb committed Dec 17, 2019
1 parent 1b6c712 commit cb010e9
Showing 1 changed file with 10 additions and 1 deletion.
Expand Up @@ -22,6 +22,7 @@
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag;
use Symfony\Component\HttpKernel\Kernel;
Expand Down Expand Up @@ -64,7 +65,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$container->setParameter('container.build_time', time());

$container->compile();
try {
$container->compile();
} catch (InvalidArgumentException $e) {
$errorIo->error($e->getMessage());

return 1;
}

$errorIo->success('The container was lint successfully: all services are injected with values that are compatible with their type declarations.');

return 0;
}
Expand Down

0 comments on commit cb010e9

Please sign in to comment.