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

Conversation

chalasr
Copy link
Member

@chalasr chalasr commented Oct 27, 2018

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)

}

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);
Copy link
Contributor

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);
Copy link
Contributor

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?

@chalasr chalasr force-pushed the visible-deprecated-opts branch 2 times, most recently from a195b0c to e3aadcb Compare October 28, 2018 11:45
@@ -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.';
Copy link
Member

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 ...

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@chalasr chalasr force-pushed the visible-deprecated-opts branch from e3aadcb to a40048e Compare October 28, 2018 15:28
@fabpot
Copy link
Member

fabpot commented Oct 28, 2018

Thank you @chalasr.

@fabpot fabpot merged commit a40048e into symfony:master Oct 28, 2018
fabpot added a commit that referenced this pull request Oct 28, 2018
…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
@chalasr chalasr deleted the visible-deprecated-opts branch October 28, 2018 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants