Skip to content

[FrameworkBundle] Display a proper warning for deprecated --env and --no-debug options #29002

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
Oct 28, 2018
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
9 changes: 7 additions & 2 deletions src/Symfony/Bundle/FrameworkBundle/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,16 @@ public function getKernel()
public function doRun(InputInterface $input, OutputInterface $output)
{
if ($input->hasParameterOption(array('-e', '--env'), true)) {
@trigger_error('The "--env" option and its "-e" shortcut are deprecated since Symfony 4.2. Set the "APP_ENV" environment variable instead.', E_USER_DEPRECATED);
$notice = 'The "--env" option and its "-e" shortcut are deprecated since Symfony 4.2, set the "APP_ENV" environment variable instead.';
$io = (new SymfonyStyle($input, $output))->getErrorStyle();
$io->warning($notice);
@trigger_error($notice, E_USER_DEPRECATED);
}

if ($input->hasParameterOption('--no-debug', true)) {
@trigger_error('The "--no-debug" option is deprecated since Symfony 4.2. Set the "APP_DEBUG" environment variable to "0" instead.', E_USER_DEPRECATED);
$notice = 'The "--no-debug" option is deprecated since Symfony 4.2, set the "APP_DEBUG" environment variable to "0" instead.';
($io ?? (new SymfonyStyle($input, $output))->getErrorStyle())->warning($notice);
@trigger_error($notice, E_USER_DEPRECATED);
}

$this->kernel->boot();
Expand Down