Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 443f8ad

Browse files
Robin Chalasnicolas-grekas
Robin Chalas
authored andcommitted
[FrameworkBundle][WebServerBundle] Revert deprecation of --env and --no-debug console options
This reverts commit 9f60ff8. This reverts commit 31b5615.
1 parent da77fc2 commit 443f8ad

File tree

7 files changed

+0
-47
lines changed

7 files changed

+0
-47
lines changed

UPGRADE-4.2.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,6 @@ FrameworkBundle
175175
```
176176
* The `ContainerAwareCommand` class has been deprecated, use `Symfony\Component\Console\Command\Command`
177177
with dependency injection instead.
178-
* The `--env` and `--no-debug` console options have been deprecated, define the `APP_ENV` and
179-
`APP_DEBUG` environment variables instead.
180-
If you want to keep using `--env` and `--no-debug`, you can take inspiration from
181-
https://github.com/symfony/recipes/blob/master/symfony/console/3.3/bin/console
182178
* The `Templating\Helper\TranslatorHelper::transChoice()` method has been deprecated, use the `trans()` one instead with a `%count%` parameter.
183179
* Deprecated support for legacy translations directories `src/Resources/translations/` and `src/Resources/<BundleName>/translations/`, use `translations/` instead.
184180
* Support for the legacy directory structure in `translation:update` and `debug:translation` commands has been deprecated.
@@ -381,9 +377,3 @@ Validator
381377
* Using the `Bic`, `Country`, `Currency`, `Language` and `Locale` constraints without `symfony/intl` is deprecated
382378
* Using the `Email` constraint in strict mode without `egulias/email-validator` is deprecated
383379
* Using the `Expression` constraint without `symfony/expression-language` is deprecated
384-
385-
WebServerBundle
386-
---------------
387-
388-
* Omitting the `$environment` argument of the `ServerRunCommand` and
389-
`ServerStartCommand` constructors is deprecated.

UPGRADE-5.0.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,6 @@ FrameworkBundle
164164
* Added support for the SameSite attribute for session cookies. It is highly recommended to set this setting (`framework.session.cookie_samesite`) to `lax` for increased security against CSRF attacks.
165165
* The `ContainerAwareCommand` class has been removed, use `Symfony\Component\Console\Command\Command`
166166
with dependency injection instead.
167-
* The `--env` and `--no-debug` console options have been removed, define the `APP_ENV` and
168-
`APP_DEBUG` environment variables instead.
169-
If you want to keep using `--env` and `--no-debug`, you can take inspiration from
170-
https://github.com/symfony/recipes/blob/master/symfony/console/3.3/bin/console
171167
* The `Templating\Helper\TranslatorHelper::transChoice()` method has been removed, use the `trans()` one instead with a `%count%` parameter.
172168
* Removed support for legacy translations directories `src/Resources/translations/` and `src/Resources/<BundleName>/translations/`, use `translations/` instead.
173169
* Support for the legacy directory structure in `translation:update` and `debug:translation` commands has been removed.
@@ -286,9 +282,3 @@ Workflow
286282
* `add` method has been removed use `addWorkflow` method in `Workflow\Registry` instead.
287283
* `SupportStrategyInterface` has been removed, use `WorkflowSupportStrategyInterface` instead.
288284
* `ClassInstanceSupportStrategy` has been removed, use `InstanceOfSupportStrategy` instead.
289-
290-
WebServerBundle
291-
---------------
292-
293-
* Omitting the `$environment` argument of the `ServerRunCommand` and
294-
`ServerStartCommand` constructors now throws a `\TypeError`.

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ CHANGELOG
1515
* Removed the `framework.messenger.encoder` and `framework.messenger.decoder` options. Use the `framework.messenger.serializer.id` option to replace the Messenger serializer.
1616
* Deprecated the `ContainerAwareCommand` class in favor of `Symfony\Component\Console\Command\Command`
1717
* Made `debug:container` and `debug:autowiring` ignore backslashes in service ids
18-
* Deprecated `--env` and `--no-debug` console options, define the `APP_ENV` and `APP_DEBUG` environment variables or
19-
parse input arguments as done in https://github.com/symfony/recipes/blob/master/symfony/console/3.3/bin/console instead
2018
* Deprecated the `Templating\Helper\TranslatorHelper::transChoice()` method, use the `trans()` one instead with a `%count%` parameter
2119
* Deprecated `CacheCollectorPass`. Use `Symfony\Component\Cache\DependencyInjection\CacheCollectorPass` instead.
2220
* Deprecated `CachePoolClearerPass`. Use `Symfony\Component\Cache\DependencyInjection\CachePoolClearerPass` instead.

src/Symfony/Bundle/FrameworkBundle/Console/Application.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,6 @@ public function getKernel()
6262
*/
6363
public function doRun(InputInterface $input, OutputInterface $output)
6464
{
65-
if ($input->hasParameterOption(array('-e', '--env'), true)) {
66-
$notice = 'The "--env" option and its "-e" shortcut are deprecated since Symfony 4.2, set the "APP_ENV" environment variable instead.';
67-
$io = (new SymfonyStyle($input, $output))->getErrorStyle();
68-
$io->warning($notice);
69-
@trigger_error($notice, E_USER_DEPRECATED);
70-
}
71-
72-
if ($input->hasParameterOption('--no-debug', true)) {
73-
$notice = 'The "--no-debug" option is deprecated since Symfony 4.2, set the "APP_DEBUG" environment variable to "0" instead.';
74-
($io ?? (new SymfonyStyle($input, $output))->getErrorStyle())->warning($notice);
75-
@trigger_error($notice, E_USER_DEPRECATED);
76-
}
77-
7865
$this->kernel->boot();
7966

8067
$this->setDispatcher($this->kernel->getContainer()->get('event_dispatcher'));

src/Symfony/Bundle/WebServerBundle/CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ CHANGELOG
44
4.2.0
55
-----
66

7-
* Deprecated omitting the `$environment` argument of the `ServerRunCommand` and
8-
`ServerStartCommand` constructors
97
* Added ability to display the current hostname address if available when binding to 0.0.0.0
108

119
3.4.0

src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ class ServerRunCommand extends Command
3636

3737
public function __construct(string $documentRoot = null, string $environment = null)
3838
{
39-
if (!$environment) {
40-
@trigger_error(sprintf('Omitting the $environment argument of the "%s" constructor is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED);
41-
}
42-
4339
$this->documentRoot = $documentRoot;
4440
$this->environment = $environment;
4541

@@ -103,7 +99,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
10399
$documentRoot = $this->documentRoot;
104100
}
105101

106-
// @deprecated since Symfony 4.2
107102
if (!$env = $this->environment) {
108103
if ($input->hasOption('env') && !$env = $input->getOption('env')) {
109104
$io->error('The environment must be either passed as second argument of the constructor or through the "--env" input option.');

src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ class ServerStartCommand extends Command
3636

3737
public function __construct(string $documentRoot = null, string $environment = null)
3838
{
39-
if (!$environment) {
40-
@trigger_error(sprintf('Omitting the $environment argument of the "%s" constructor is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED);
41-
}
42-
4339
$this->documentRoot = $documentRoot;
4440
$this->environment = $environment;
4541

@@ -116,7 +112,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
116112
$documentRoot = $this->documentRoot;
117113
}
118114

119-
// @deprecated since Symfony 4.2
120115
if (!$env = $this->environment) {
121116
if ($input->hasOption('env') && !$env = $input->getOption('env')) {
122117
$io->error('The environment must be either passed as second argument of the constructor or through the "--env" input option.');

0 commit comments

Comments
 (0)