Skip to content

Commit 4ce19bc

Browse files
committed
[FrameworkBundle][ContainerLintCommand] Style messages
1 parent 7fee55c commit 4ce19bc

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Command/ContainerLintCommand.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
2323
use Symfony\Component\DependencyInjection\Container;
2424
use Symfony\Component\DependencyInjection\ContainerBuilder;
25+
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
2526
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
2627
use Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag;
2728
use Symfony\Component\HttpKernel\Kernel;
@@ -64,7 +65,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6465

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

67-
$container->compile();
68+
try {
69+
$container->compile();
70+
} catch (InvalidArgumentException $e) {
71+
$errorIo->error($e->getMessage());
72+
73+
return 1;
74+
}
75+
76+
$io->success('The container was lint successfully: all services are injected with values that are compatible with their type declarations.');
6877

6978
return 0;
7079
}

0 commit comments

Comments
 (0)