Skip to content

Commit a3845c7

Browse files
committed
improve deprecation messages
1 parent 3384b2d commit a3845c7

File tree

28 files changed

+48
-48
lines changed

28 files changed

+48
-48
lines changed

src/Symfony/Bridge/Twig/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
}

src/Symfony/Bridge/Twig/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
}

src/Symfony/Bridge/Twig/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
*/

src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class CacheWarmupCommand extends ContainerAwareCommand
3636
public function __construct($cacheWarmer = null)
3737
{
3838
if (!$cacheWarmer instanceof CacheWarmerAggregate) {
39-
@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);
39+
@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);
4040

4141
parent::__construct($cacheWarmer);
4242

src/Symfony/Bundle/FrameworkBundle/Command/XliffLintCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class XliffLintCommand extends BaseLintCommand
2929
public function __construct($name = null, $directoryIteratorProvider = null, $isReadableProvider = null)
3030
{
3131
if (func_num_args()) {
32-
@trigger_error(sprintf('Passing a constructor argument in "%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);
32+
@trigger_error(sprintf('Passing a constructor argument in "%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);
3333
}
3434

3535
if (null === $directoryIteratorProvider) {

src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class YamlLintCommand extends BaseLintCommand
2828
public function __construct($name = null, $directoryIteratorProvider = null, $isReadableProvider = null)
2929
{
3030
if (func_num_args()) {
31-
@trigger_error(sprintf('Passing a constructor argument in "%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);
31+
@trigger_error(sprintf('Passing a constructor argument in "%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);
3232
}
3333

3434
if (null === $directoryIteratorProvider) {

src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function deleteTmpDir()
4545

4646
/**
4747
* @group legacy
48-
* @expectedDeprecation Method Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct() takes the default locale as 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0.
48+
* @expectedDeprecation The "Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct()" method takes the default locale as the 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0.
4949
*/
5050
public function testTransWithoutCachingOmittingLocale()
5151
{
@@ -66,7 +66,7 @@ public function testTransWithoutCachingOmittingLocale()
6666

6767
/**
6868
* @group legacy
69-
* @expectedDeprecation Method Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct() takes the default locale as 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0.
69+
* @expectedDeprecation The "Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct()" method takes the default locale as the 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0.
7070
*/
7171
public function testTransWithCachingOmittingLocale()
7272
{
@@ -106,7 +106,7 @@ public function testTransWithCachingOmittingLocale()
106106

107107
/**
108108
* @group legacy
109-
* @expectedDeprecation Method Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct() takes the default locale as 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0.
109+
* @expectedDeprecation The "Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct()" method takes the default locale as the 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0.
110110
* @expectedException \InvalidArgumentException
111111
*/
112112
public function testTransWithCachingWithInvalidLocaleOmittingLocale()
@@ -119,7 +119,7 @@ public function testTransWithCachingWithInvalidLocaleOmittingLocale()
119119

120120
/**
121121
* @group legacy
122-
* @expectedDeprecation Method Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct() takes the default locale as 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0.
122+
* @expectedDeprecation The "Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct()" method takes the default locale as the 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0.
123123
*/
124124
public function testLoadResourcesWithoutCachingOmittingLocale()
125125
{
@@ -138,7 +138,7 @@ public function testLoadResourcesWithoutCachingOmittingLocale()
138138

139139
/**
140140
* @group legacy
141-
* @expectedDeprecation Method Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct() takes the default locale as 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0.
141+
* @expectedDeprecation The "Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct()" method takes the default locale as the 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0.
142142
*/
143143
public function testGetDefaultLocaleOmittingLocale()
144144
{
@@ -167,7 +167,7 @@ public function testGetDefaultLocaleOmittingLocaleWithPsrContainer()
167167

168168
/**
169169
* @group legacy
170-
* @expectedDeprecation Method Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct() takes the default locale as 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0.
170+
* @expectedDeprecation The "Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct()" method takes the default locale as the 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0.
171171
*/
172172
public function testWarmupOmittingLocale()
173173
{

src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function __construct(ContainerInterface $container, $formatter, $defaultL
7575
$options = $loaderIds;
7676
$loaderIds = $defaultLocale;
7777
$defaultLocale = $container->getParameter('kernel.default_locale');
78-
@trigger_error(sprintf('Method %s() takes the default locale as 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0.', __METHOD__), E_USER_DEPRECATED);
78+
@trigger_error(sprintf('The "%s()" method takes the default locale as the 3rd argument since Symfony 3.3. Not passing it is deprecated and will trigger an error in 4.0.', __METHOD__), E_USER_DEPRECATED);
7979
}
8080

8181
$this->container = $container;

src/Symfony/Bundle/SecurityBundle/Command/UserPasswordEncoderCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class UserPasswordEncoderCommand extends ContainerAwareCommand
4242
public function __construct(EncoderFactoryInterface $encoderFactory = null, array $userClasses = array())
4343
{
4444
if (null === $encoderFactory) {
45-
@trigger_error(sprintf('Passing null as the first argument of "%s" is deprecated since Symfony 3.3 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED);
45+
@trigger_error(sprintf('Passing null as the first argument of "%s()" is deprecated since Symfony 3.3 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);
4646
}
4747

4848
$this->encoderFactory = $encoderFactory;

src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function getConfig()
5555
*/
5656
public function getContext()
5757
{
58-
@trigger_error(sprintf('Method %s() is deprecated since Symfony 3.3 and will be removed in 4.0. Use %s::getListeners/getExceptionListener() instead.', __METHOD__, __CLASS__), E_USER_DEPRECATED);
58+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use %s::getListeners/getExceptionListener() instead.', __METHOD__, __CLASS__), E_USER_DEPRECATED);
5959

6060
return array($this->getListeners(), $this->getExceptionListener(), $this->getLogoutListener());
6161
}

0 commit comments

Comments
 (0)