Skip to content

Commit 748f725

Browse files
committed
normalize deprecation messages to be consistent
1 parent 81032aa commit 748f725

File tree

32 files changed

+51
-51
lines changed

32 files changed

+51
-51
lines changed

src/Symfony/Bundle/FrameworkBundle/Controller/ControllerNameParser.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
* @author Fabien Potencier <fabien@symfony.com>
2222
*
23-
* @deprecated since version 4.1, will be removed in 5.0.
23+
* @deprecated since Symfony 4.1, to be removed in 5.0
2424
*/
2525
class ControllerNameParser
2626
{
@@ -43,7 +43,7 @@ public function __construct(KernelInterface $kernel)
4343
*/
4444
public function parse($controller)
4545
{
46-
@trigger_error(sprintf('The %s class is deprecated since version 4.1 and will be removed in 5.0.', __CLASS__), E_USER_DEPRECATED);
46+
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.1.', __CLASS__), E_USER_DEPRECATED);
4747

4848
$parts = explode(':', $controller);
4949
if (3 !== count($parts) || in_array('', $parts, true)) {
@@ -90,7 +90,7 @@ public function parse($controller)
9090
*/
9191
public function build($controller)
9292
{
93-
@trigger_error(sprintf('The %s class is deprecated since version 4.1 and will be removed in 5.0.', __CLASS__), E_USER_DEPRECATED);
93+
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.1.', __CLASS__), E_USER_DEPRECATED);
9494

9595
if (0 === preg_match('#^(.*?\\\\Controller\\\\(.+)Controller)::(.+)Action$#', $controller, $match)) {
9696
throw new \InvalidArgumentException(sprintf('The "%s" controller is not a valid "class::method" string.', $controller));

src/Symfony/Bundle/FrameworkBundle/Controller/ControllerResolver.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected function createController($controller)
4141
$controller = $this->parser->parse($deprecatedNotation);
4242

4343
@trigger_error(sprintf(
44-
'Referencing controllers with %s is deprecated since version 4.1 and will be removed in 5.0. Use %s instead.',
44+
'Referencing controllers with %s is deprecated since Symfony 4.1. Use %s instead.',
4545
$deprecatedNotation,
4646
$controller
4747
), E_USER_DEPRECATED);

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ private function addValidationSection(ArrayNodeDefinition $rootNode)
659659
->beforeNormalization()
660660
->ifTrue(function ($v) { return isset($v['strict_email']); })
661661
->then(function ($v) {
662-
@trigger_error('The "framework.validation.strict_email" configuration key has been deprecated in Symfony 4.1. Use the "framework.validation.email_validation_mode" configuration key instead.', E_USER_DEPRECATED);
662+
@trigger_error('The "framework.validation.strict_email" configuration key is deprecated since Symfony 4.1. Use the "framework.validation.email_validation_mode" configuration key instead.', E_USER_DEPRECATED);
663663

664664
return $v;
665665
})

src/Symfony/Bundle/FrameworkBundle/EventListener/ResolveControllerNameSubscriber.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
* @author Ryan Weaver <ryan@knpuniversity.com>
2323
*
24-
* @deprecated since version 4.1, will be removed in 5.0.
24+
* @deprecated since Symfony 4.1, to be removed in 5.0
2525
*/
2626
class ResolveControllerNameSubscriber implements EventSubscriberInterface
2727
{

src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
</service>
7171

7272
<service id="session.save_listener" class="Symfony\Component\HttpKernel\EventListener\SaveSessionListener">
73-
<deprecated>The "%service_id%" service is deprecated since Symfony 4.1 and will be removed in 5.0. Use the "session_listener" service instead.</deprecated>
73+
<deprecated>The "%service_id%" service is deprecated since Symfony 4.1. Use the "session_listener" service instead.</deprecated>
7474
</service>
7575

7676
<!-- for BC -->

src/Symfony/Bundle/FrameworkBundle/Routing/DelegatingLoader.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function load($resource, $type = null)
8888
$controller = $this->parser->parse($controller);
8989

9090
@trigger_error(sprintf(
91-
'Referencing controllers with %s is deprecated since version 4.1 and will be removed in 5.0. Use %s instead.',
91+
'Referencing controllers with %s is deprecated since Symfony 4.1. Use %s instead.',
9292
$deprecatedNotation,
9393
$controller
9494
), E_USER_DEPRECATED);
@@ -100,7 +100,7 @@ public function load($resource, $type = null)
100100
if (1 === substr_count($controller, ':')) {
101101
$controller = str_replace(':', '::', $controller);
102102
@trigger_error(sprintf(
103-
'Referencing controllers with a single colon is deprecated since version 4.1 and will be removed in 5.0. Use %s instead.',
103+
'Referencing controllers with a single colon is deprecated since Symfony 4.1. Use %s instead.',
104104
$controller
105105
), E_USER_DEPRECATED);
106106
}

src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerResolverTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testGetControllerOnContainerAwareInvokable()
5252

5353
/**
5454
* @group legacy
55-
* @expectedDeprecation Referencing controllers with FooBundle:Default:test is deprecated since version 4.1 and will be removed in 5.0. Use Symfony\Bundle\FrameworkBundle\Tests\Controller\ContainerAwareController::testAction instead.
55+
* @expectedDeprecation Referencing controllers with FooBundle:Default:test is deprecated since Symfony 4.1. Use Symfony\Bundle\FrameworkBundle\Tests\Controller\ContainerAwareController::testAction instead.
5656
*/
5757
public function testGetControllerWithBundleNotation()
5858
{

src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $facto
200200
->booleanNode('logout_on_user_change')
201201
->defaultTrue()
202202
->info('When true, it will trigger a logout for the user if something has changed. Note: No-Op option since 4.0. Will always be true.')
203-
->setDeprecated('The "%path%.%node%" configuration key has been deprecated in Symfony 4.1 and will be removed in 5.0.')
203+
->setDeprecated('The "%path%.%node%" configuration key is deprecated since Symfony 4.1.')
204204
->end()
205205
->arrayNode('logout')
206206
->treatTrueLike(array())

src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
<!-- Provisioning -->
166166
<service id="security.user.provider.in_memory" class="Symfony\Component\Security\Core\User\InMemoryUserProvider" abstract="true" />
167167
<service id="security.user.provider.in_memory.user" class="Symfony\Component\Security\Core\User\User" abstract="true">
168-
<deprecated>The "%service_id%" service is deprecated since Symfony 4.1 and will be removed in 5.0.</deprecated>
168+
<deprecated>The "%service_id%" service is deprecated since Symfony 4.1.</deprecated>
169169
</service>
170170

171171
<service id="security.user.provider.ldap" class="Symfony\Component\Security\Core\User\LdapUserProvider" abstract="true">

src/Symfony/Bundle/SecurityBundle/SecurityUserValueResolver.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
use Symfony\Component\Security\Core\User\UserInterface;
2020
use Symfony\Component\Security\Http\Controller\UserValueResolver;
2121

22-
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.1 and will be removed in 5.0, use "%s" instead.', SecurityUserValueResolver::class, UserValueResolver::class), E_USER_DEPRECATED);
22+
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.1. Use "%s" instead.', SecurityUserValueResolver::class, UserValueResolver::class), E_USER_DEPRECATED);
2323

2424
/**
2525
* Supports the argument type of {@see UserInterface}.

src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ public function setPathSeparator(string $separator)
364364
$child->setPathSeparator($separator);
365365
}
366366
} else {
367-
@trigger_error('Passing a ParentNodeDefinitionInterface without getChildNodeDefinitions() is deprecated since version 4.1 and will be removed in 5.0.', E_USER_DEPRECATED);
367+
@trigger_error('Passing a ParentNodeDefinitionInterface without getChildNodeDefinitions() is deprecated since Symfony 4.1.', E_USER_DEPRECATED);
368368
}
369369
}
370370

src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcherInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
1515

1616
/**
17-
* @deprecated since version 4.1, will be removed in 5.0.
17+
* @deprecated since Symfony 4.1, to be removed in 5.0
1818
*
1919
* @author Fabien Potencier <fabien@symfony.com>
2020
*/

src/Symfony/Component/HttpFoundation/File/UploadedFile.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,13 @@ public function guessClientExtension()
145145
* It is extracted from the request from which the file has been uploaded.
146146
* Then it should not be considered as a safe value.
147147
*
148-
* @deprecated since 4.1 will be removed in 5.0 use getSize() instead.
148+
* @deprecated since Symfony 4.1, to be removed in 5.0. Use getSize() instead.
149149
*
150150
* @return int|null The file sizes
151151
*/
152152
public function getClientSize()
153153
{
154-
@trigger_error(sprintf('"%s" is deprecated since Symfony 4.1 and will be removed in 5.0. Use getSize() instead.', __METHOD__), E_USER_DEPRECATED);
154+
@trigger_error(sprintf('"%s" is deprecated since Symfony 4.1. Use getSize() instead.', __METHOD__), E_USER_DEPRECATED);
155155

156156
return $this->getSize();
157157
}

src/Symfony/Component/HttpKernel/Controller/ContainerControllerResolver.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected function createController($controller)
3737
if (1 === substr_count($controller, ':')) {
3838
$controller = str_replace(':', '::', $controller);
3939
@trigger_error(sprintf(
40-
'Referencing controllers with a single colon is deprecated since version 4.1 and will be removed in 5.0. Use %s instead.',
40+
'Referencing controllers with a single colon is deprecated since Symfony 4.1. Use %s instead.',
4141
$controller
4242
), E_USER_DEPRECATED);
4343
}

src/Symfony/Component/HttpKernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function process(ContainerBuilder $container)
5656
}
5757
}
5858
if (!$reason) {
59-
// deprecated since version 4.1 and will be removed in 5.0. See Symfony\Component\HttpKernel\Controller\ContainerControllerResolver
59+
// deprecated since Symfony 4.1, to be removed in 5.0. See Symfony\Component\HttpKernel\Controller\ContainerControllerResolver
6060
$controllers[$id.':'.$action] = $argumentRef;
6161

6262
if ('__invoke' === $action) {

src/Symfony/Component/HttpKernel/EventListener/SaveSessionListener.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\HttpKernel\EventListener;
1313

14-
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.1 and will be removed in 5.0. Use AbstractSessionListener instead.', SaveSessionListener::class), E_USER_DEPRECATED);
14+
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.1. Use AbstractSessionListener instead.', SaveSessionListener::class), E_USER_DEPRECATED);
1515

1616
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
1717
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;

src/Symfony/Component/HttpKernel/Tests/Controller/ContainerControllerResolverTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ContainerControllerResolverTest extends ControllerResolverTest
2222
{
2323
/**
2424
* @group legacy
25-
* @expectedDeprecation Referencing controllers with a single colon is deprecated since version 4.1 and will be removed in 5.0. Use foo::action instead.
25+
* @expectedDeprecation Referencing controllers with a single colon is deprecated since Symfony 4.1. Use foo::action instead.
2626
*/
2727
public function testGetControllerServiceWithSingleColon()
2828
{

src/Symfony/Component/Routing/Loader/ObjectRouteLoader.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function load($resource, $type = null)
4747
if (1 === substr_count($resource, ':')) {
4848
$resource = str_replace(':', '::', $resource);
4949
@trigger_error(sprintf(
50-
'Referencing service route loaders with a single colon is deprecated since version 4.1 and will be removed in 5.0. Use %s instead.',
50+
'Referencing service route loaders with a single colon is deprecated since Symfony 4.1. Use %s instead.',
5151
$resource
5252
), E_USER_DEPRECATED);
5353
}

src/Symfony/Component/Routing/Tests/Loader/ObjectRouteLoaderTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ObjectRouteLoaderTest extends TestCase
2020
{
2121
/**
2222
* @group legacy
23-
* @expectedDeprecation Referencing service route loaders with a single colon is deprecated since version 4.1 and will be removed in 5.0. Use my_route_provider_service::loadRoutes instead.
23+
* @expectedDeprecation Referencing service route loaders with a single colon is deprecated since Symfony 4.1. Use my_route_provider_service::loadRoutes instead.
2424
*/
2525
public function testLoadCallsServiceAndReturnsCollectionWithLegacyNotation()
2626
{

src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ private function hasUserChanged(UserInterface $user)
261261
}
262262

263263
if ($this->user instanceof AdvancedUserInterface && $user instanceof AdvancedUserInterface) {
264-
@trigger_error(sprintf('Checking for the AdvancedUserInterface in %s has been deprecated in 4.1 and will be removed in 5.0. Implement the %s to check if the user has been changed,', __METHOD__, EquatableInterface::class), E_USER_DEPRECATED);
264+
@trigger_error(sprintf('Checking for the AdvancedUserInterface in %s is deprecated since Symfony 4.1. Implement the %s to check if the user has been changed,', __METHOD__, EquatableInterface::class), E_USER_DEPRECATED);
265265
if ($this->user->isAccountNonExpired() !== $user->isAccountNonExpired()) {
266266
return true;
267267
}
@@ -278,7 +278,7 @@ private function hasUserChanged(UserInterface $user)
278278
return true;
279279
}
280280
} elseif ($this->user instanceof AdvancedUserInterface xor $user instanceof AdvancedUserInterface) {
281-
@trigger_error(sprintf('Checking for the AdvancedUserInterface in %s has been deprecated in 4.1 and will be removed in 5.0. Implement the %s to check if the user has been changed,', __METHOD__, EquatableInterface::class), E_USER_DEPRECATED);
281+
@trigger_error(sprintf('Checking for the AdvancedUserInterface in %s is deprecated since Symfony 4.1. Implement the %s to check if the user has been changed,', __METHOD__, EquatableInterface::class), E_USER_DEPRECATED);
282282

283283
return true;
284284
}

src/Symfony/Component/Security/Core/Tests/User/UserCheckerTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testCheckPostAuthPass()
3232

3333
/**
3434
* @group legacy
35-
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPostAuth with an AdvancedUserInterface is deprecated as of 4.1 and will be removed in 5.0. Create a custom user checker if you wish to keep this functionality.
35+
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPostAuth with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality.
3636
*/
3737
public function testCheckPostAuthPassAdvancedUser()
3838
{
@@ -55,7 +55,7 @@ public function testCheckPostAuthCredentialsExpired()
5555

5656
/**
5757
* @group legacy
58-
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPostAuth with an AdvancedUserInterface is deprecated as of 4.1 and will be removed in 5.0. Create a custom user checker if you wish to keep this functionality.
58+
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPostAuth with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality.
5959
* @expectedException \Symfony\Component\Security\Core\Exception\CredentialsExpiredException
6060
*/
6161
public function testCheckPostAuthCredentialsExpiredAdvancedUser()
@@ -70,7 +70,7 @@ public function testCheckPostAuthCredentialsExpiredAdvancedUser()
7070

7171
/**
7272
* @group legacy
73-
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPreAuth with an AdvancedUserInterface is deprecated as of 4.1 and will be removed in 5.0. Create a custom user checker if you wish to keep this functionality.
73+
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPreAuth with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality.
7474
*/
7575
public function testCheckPreAuthPassAdvancedUser()
7676
{
@@ -95,7 +95,7 @@ public function testCheckPreAuthAccountLocked()
9595

9696
/**
9797
* @group legacy
98-
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPreAuth with an AdvancedUserInterface is deprecated as of 4.1 and will be removed in 5.0. Create a custom user checker if you wish to keep this functionality.
98+
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPreAuth with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality.
9999
* @expectedException \Symfony\Component\Security\Core\Exception\LockedException
100100
*/
101101
public function testCheckPreAuthAccountLockedAdvancedUser()
@@ -119,7 +119,7 @@ public function testCheckPreAuthDisabled()
119119

120120
/**
121121
* @group legacy
122-
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPreAuth with an AdvancedUserInterface is deprecated as of 4.1 and will be removed in 5.0. Create a custom user checker if you wish to keep this functionality.
122+
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPreAuth with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality.
123123
* @expectedException \Symfony\Component\Security\Core\Exception\DisabledException
124124
*/
125125
public function testCheckPreAuthDisabledAdvancedUser()
@@ -144,7 +144,7 @@ public function testCheckPreAuthAccountExpired()
144144

145145
/**
146146
* @group legacy
147-
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPreAuth with an AdvancedUserInterface is deprecated as of 4.1 and will be removed in 5.0. Create a custom user checker if you wish to keep this functionality.
147+
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPreAuth with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality.
148148
* @expectedException \Symfony\Component\Security\Core\Exception\AccountExpiredException
149149
*/
150150
public function testCheckPreAuthAccountExpiredAdvancedUser()

src/Symfony/Component/Security/Core/User/AdvancedUserInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
*
3333
* @see UserInterface
3434
* @see AccountStatusException
35-
* @deprecated since version 4.1, will be removed in 5.0.
35+
* @deprecated since Symfony 4.1, to be removed in 5.0
3636
*
3737
* @author Fabien Potencier <fabien@symfony.com>
3838
*/

src/Symfony/Component/Security/Core/User/UserChecker.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function checkPreAuth(UserInterface $user)
3333
}
3434

3535
if ($user instanceof AdvancedUserInterface && !$user instanceof User) {
36-
@trigger_error(sprintf('Calling %s with an AdvancedUserInterface is deprecated as of 4.1 and will be removed in 5.0. Create a custom user checker if you wish to keep this functionality.', __METHOD__), E_USER_DEPRECATED);
36+
@trigger_error(sprintf('Calling %s with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality.', __METHOD__), E_USER_DEPRECATED);
3737
}
3838

3939
if (!$user->isAccountNonLocked()) {
@@ -65,7 +65,7 @@ public function checkPostAuth(UserInterface $user)
6565
}
6666

6767
if ($user instanceof AdvancedUserInterface && !$user instanceof User) {
68-
@trigger_error(sprintf('Calling %s with an AdvancedUserInterface is deprecated as of 4.1 and will be removed in 5.0. Create a custom user checker if you wish to keep this functionality.', __METHOD__), E_USER_DEPRECATED);
68+
@trigger_error(sprintf('Calling %s with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality.', __METHOD__), E_USER_DEPRECATED);
6969
}
7070

7171
if (!$user->isCredentialsNonExpired()) {

src/Symfony/Component/Security/Http/Firewall/ContextListener.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function __construct(TokenStorageInterface $tokenStorage, iterable $userP
7171
*/
7272
public function setLogoutOnUserChange($logoutOnUserChange)
7373
{
74-
@trigger_error(sprintf('The %s() method is deprecated since Symfony 4.1 and will be removed in 5.0.', __METHOD__), E_USER_DEPRECATED);
74+
@trigger_error(sprintf('The %s() method is deprecated since Symfony 4.1.', __METHOD__), E_USER_DEPRECATED);
7575
}
7676

7777
/**

0 commit comments

Comments
 (0)