[WebServerBundle] Deprecate relying on --env in server:start and server:run
This commit is contained in:
parent
3e7b029524
commit
31b5615b51
@ -231,3 +231,9 @@ Validator
|
||||
* Using the `Bic`, `Country`, `Currency`, `Language` and `Locale` constraints without `symfony/intl` is deprecated
|
||||
* Using the `Email` constraint without `egulias/email-validator` is deprecated
|
||||
* Using the `Expression` constraint without `symfony/expression-language` is deprecated
|
||||
|
||||
WebServerBundle
|
||||
---------------
|
||||
|
||||
* Omitting the `$environment` argument of the `ServerRunCommand` and
|
||||
`ServerStartCommand` constructors is deprecated.
|
||||
|
@ -222,3 +222,9 @@ Workflow
|
||||
* `add` method has been removed use `addWorkflow` method in `Workflow\Registry` instead.
|
||||
* `SupportStrategyInterface` has been removed, use `WorkflowSupportStrategyInterface` instead.
|
||||
* `ClassInstanceSupportStrategy` has been removed, use `InstanceOfSupportStrategy` instead.
|
||||
|
||||
WebServerBundle
|
||||
---------------
|
||||
|
||||
* Omitting the `$environment` argument of the `ServerRunCommand` and
|
||||
`ServerStartCommand` constructors now throws a `\TypeError.
|
||||
|
@ -1,6 +1,12 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
4.2.0
|
||||
-----
|
||||
|
||||
* Deprecated omitting the `$environment` argument of the `ServerRunCommand` and
|
||||
`ServerStartCommand` constructors
|
||||
|
||||
3.4.0
|
||||
-----
|
||||
|
||||
|
@ -36,6 +36,10 @@ class ServerRunCommand extends Command
|
||||
|
||||
public function __construct(string $documentRoot = null, string $environment = null)
|
||||
{
|
||||
if (!$environment) {
|
||||
@trigger_error(sprintf('Omitting the $environment argument of the "%s" constructor is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
$this->documentRoot = $documentRoot;
|
||||
$this->environment = $environment;
|
||||
|
||||
@ -99,6 +103,7 @@ EOF
|
||||
$documentRoot = $this->documentRoot;
|
||||
}
|
||||
|
||||
// @deprecated since Symfony 4.2
|
||||
if (!$env = $this->environment) {
|
||||
if ($input->hasOption('env') && !$env = $input->getOption('env')) {
|
||||
$io->error('The environment must be either passed as second argument of the constructor or through the "--env" input option.');
|
||||
|
@ -36,6 +36,10 @@ class ServerStartCommand extends Command
|
||||
|
||||
public function __construct(string $documentRoot = null, string $environment = null)
|
||||
{
|
||||
if (!$environment) {
|
||||
@trigger_error(sprintf('Omitting the $environment argument of the "%s" constructor is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
$this->documentRoot = $documentRoot;
|
||||
$this->environment = $environment;
|
||||
|
||||
@ -112,6 +116,7 @@ EOF
|
||||
$documentRoot = $this->documentRoot;
|
||||
}
|
||||
|
||||
// @deprecated since Symfony 4.2
|
||||
if (!$env = $this->environment) {
|
||||
if ($input->hasOption('env') && !$env = $input->getOption('env')) {
|
||||
$io->error('The environment must be either passed as second argument of the constructor or through the "--env" input option.');
|
||||
|
Reference in New Issue
Block a user