Skip to content

[FrameworkBundle] Add --resolve-env-vars option to lint:container command #58199

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
Sep 16, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CHANGELOG
---

* Add support for setting `headers` with `Symfony\Bundle\FrameworkBundle\Controller\TemplateController`
* Add `--resolve-env-vars` option to `lint:container` command
* Derivate `kernel.secret` from the decryption secret when its env var is not defined
* Make the `config/` directory optional in `MicroKernelTrait`, add support for service arguments in the
invokable Kernel class, and register `FrameworkBundle` by default when the `bundles.php` file is missing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Exception\RuntimeException;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\DependencyInjection\Compiler\CheckAliasValidityPass;
Expand All @@ -39,6 +40,7 @@ protected function configure(): void
{
$this
->setHelp('This command parses service definitions and ensures that injected values match the type declarations of each services\' class.')
->addOption('resolve-env-vars', null, InputOption::VALUE_NONE, 'Resolve environment variables and fail if one is missing.')
;
}

Expand All @@ -58,7 +60,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$container->setParameter('container.build_time', time());

try {
$container->compile();
$container->compile((bool) $input->getOption('resolve-env-vars'));
} catch (InvalidArgumentException $e) {
$errorIo->error($e->getMessage());

Expand Down