Skip to content

Commit d14c6e2

Browse files
committed
improve deprecation messages
1 parent 782ac8d commit d14c6e2

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Command/DebugCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class DebugCommand extends Command
3939
public function __construct($twig = null, $projectDir = null)
4040
{
4141
if (!$twig instanceof Environment) {
42-
@trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since Symfony 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED);
42+
@trigger_error(sprintf('Passing a command name as the first argument of "%s()" is deprecated since Symfony 3.4 and support for it will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED);
4343

4444
parent::__construct($twig);
4545

@@ -54,7 +54,7 @@ public function __construct($twig = null, $projectDir = null)
5454

5555
public function setTwigEnvironment(Environment $twig)
5656
{
57-
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED);
57+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED);
5858

5959
$this->twig = $twig;
6060
}
@@ -64,7 +64,7 @@ public function setTwigEnvironment(Environment $twig)
6464
*/
6565
protected function getTwigEnvironment()
6666
{
67-
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED);
67+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED);
6868

6969
return $this->twig;
7070
}

Command/LintCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class LintCommand extends Command
4343
public function __construct($twig = null)
4444
{
4545
if (!$twig instanceof Environment) {
46-
@trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since Symfony 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED);
46+
@trigger_error(sprintf('Passing a command name as the first argument of "%s()" is deprecated since Symfony 3.4 and support for it will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED);
4747

4848
parent::__construct($twig);
4949

@@ -57,7 +57,7 @@ public function __construct($twig = null)
5757

5858
public function setTwigEnvironment(Environment $twig)
5959
{
60-
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED);
60+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED);
6161

6262
$this->twig = $twig;
6363
}
@@ -67,7 +67,7 @@ public function setTwigEnvironment(Environment $twig)
6767
*/
6868
protected function getTwigEnvironment()
6969
{
70-
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED);
70+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED);
7171

7272
return $this->twig;
7373
}

Tests/Command/LintCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function testLintFileCompileTimeException()
7070

7171
/**
7272
* @group legacy
73-
* @expectedDeprecation Passing a command name as the first argument of "Symfony\Bridge\Twig\Command\LintCommand::__construct" is deprecated since Symfony 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.
73+
* @expectedDeprecation Passing a command name as the first argument of "Symfony\Bridge\Twig\Command\LintCommand::__construct()" is deprecated since Symfony 3.4 and support for it will be removed in 4.0. If the command was registered by convention, make it a service instead.
7474
* @expectedException \RuntimeException
7575
* @expectedExceptionMessage The Twig environment needs to be set.
7676
*/

0 commit comments

Comments
 (0)