-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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
Conversation
} | ||
|
||
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 instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output))->warning($notice); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not much relevant, but:
- $io ?: new SymfonyStyle
+ $io ?? new SymfonyStyle
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 instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using ->getErrorStyle()
instead?
a195b0c
to
e3aadcb
Compare
@@ -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.'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... since Symfony 4.2, set the ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
…-no-debug options
e3aadcb
to
a40048e
Compare
Thank you @chalasr. |
…d --env and --no-debug options (chalasr) This PR was merged into the 4.2-dev branch. Discussion ---------- [FrameworkBundle] Display a proper warning for deprecated --env and --no-debug options | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Currently hidden (remember #23328) Commits ------- a40048e [FrameworkBundle] Display a proper warning for deprecated --env and --no-debug options
Currently hidden (remember #23328)