Skip to content

[FrameworkBundle][ContainerLintCommand] Style messages #34865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
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) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check if the exception was thrown in CheckTypeDeclarationsPass?

$errorIo->error($e->getMessage());

return 1;
}

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

return 0;
}
Expand Down