Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit af3c205

Browse filesBrowse 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 ------- 93aa5bc [FrameworkBundle][ContainerLintCommand] Style messages
2 parents 20e8cb2 + 93aa5bc commit af3c205
Copy full SHA for af3c205

File tree

1 file changed

+10
-1
lines changed
Filter options

1 file changed

+10
-1
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Command/ContainerLintCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/ContainerLintCommand.php
+10-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.