Skip to content

Commit d37b15b

Browse files
committed
feature #34865 [FrameworkBundle][ContainerLintCommand] Style messages (fancyweb)
This PR was merged into the 5.1-dev branch. Discussion ---------- [FrameworkBundle][ContainerLintCommand] Style messages | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - It gives a better feedback. Commits ------- 93aa5bcd0a [FrameworkBundle][ContainerLintCommand] Style messages
2 parents 5a27267 + 4ce19bc commit d37b15b

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)