Skip to content

Commit c53e8a8

Browse files
committed
minor symfony#24923 [SecurityBundle] Improve deprecation messages (chalasr)
This PR was merged into the 3.4 branch. Discussion ---------- [SecurityBundle] Improve deprecation messages | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- c0cf57a [SecurityBundle] Improve deprecations
2 parents b0ce1c1 + c0cf57a commit c53e8a8

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSecurityVotersPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function process(ContainerBuilder $container)
4646
$class = $container->getParameterBag()->resolveValue($definition->getClass());
4747

4848
if (!is_a($class, VoterInterface::class, true)) {
49-
@trigger_error(sprintf('Using a "security.voter" tag on a class without implementing the "%s" is deprecated as of 3.4 and will be removed in 4.0. Implement the interface instead.', VoterInterface::class), E_USER_DEPRECATED);
49+
@trigger_error(sprintf('Using a "security.voter" tag on a class without implementing the "%s" is deprecated as of 3.4 and will throw an exception in 4.0. Implement the interface instead.', VoterInterface::class), E_USER_DEPRECATED);
5050
}
5151

5252
if (!method_exists($class, 'vote')) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ private function createFirewalls($config, ContainerBuilder $container)
280280
}
281281

282282
if (!isset($firewall['logout_on_user_change']) || !$firewall['logout_on_user_change']) {
283-
@trigger_error('Setting "logout_on_user_change" to false is deprecated as of 3.4 and will always be true in 4.0. Set it to true in your firewall configuration.', E_USER_DEPRECATED);
283+
@trigger_error(sprintf('Not setting "logout_on_user_change" to true on firewall "%s" is deprecated as of 3.4, it will always be true in 4.0.', $name), E_USER_DEPRECATED);
284284
}
285285

286286
$contextListenerDefinition->addMethodCall('setLogoutOnUserChange', array($firewall['logout_on_user_change']));

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSecurityVotersPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function testThatSecurityVotersAreProcessedInPriorityOrder()
7272

7373
/**
7474
* @group legacy
75-
* @expectedDeprecation Using a "security.voter" tag on a class without implementing the "Symfony\Component\Security\Core\Authorization\Voter\VoterInterface" is deprecated as of 3.4 and will be removed in 4.0. Implement the interface instead.
75+
* @expectedDeprecation Using a "security.voter" tag on a class without implementing the "Symfony\Component\Security\Core\Authorization\Voter\VoterInterface" is deprecated as of 3.4 and will throw an exception in 4.0. Implement the interface instead.
7676
*/
7777
public function testVoterMissingInterface()
7878
{

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function testDisableRoleHierarchyVoter()
125125

126126
/**
127127
* @group legacy
128-
* @expectedDeprecation Setting "logout_on_user_change" to false is deprecated as of 3.4 and will always be true in 4.0. Set it to true in your firewall configuration.
128+
* @expectedDeprecation Not setting "logout_on_user_change" to true on firewall "some_firewall" is deprecated as of 3.4, it will always be true in 4.0.
129129
*/
130130
public function testDeprecationForUserLogout()
131131
{

0 commit comments

Comments
 (0)