[SecurityBundle] Improve deprecations
This commit is contained in:
parent
b0ce1c13b1
commit
c0cf57aa7d
@ -46,7 +46,7 @@ class AddSecurityVotersPass implements CompilerPassInterface
|
||||
$class = $container->getParameterBag()->resolveValue($definition->getClass());
|
||||
|
||||
if (!is_a($class, VoterInterface::class, true)) {
|
||||
@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);
|
||||
@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);
|
||||
}
|
||||
|
||||
if (!method_exists($class, 'vote')) {
|
||||
|
@ -280,7 +280,7 @@ class SecurityExtension extends Extension
|
||||
}
|
||||
|
||||
if (!isset($firewall['logout_on_user_change']) || !$firewall['logout_on_user_change']) {
|
||||
@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);
|
||||
@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);
|
||||
}
|
||||
|
||||
$contextListenerDefinition->addMethodCall('setLogoutOnUserChange', array($firewall['logout_on_user_change']));
|
||||
|
@ -72,7 +72,7 @@ class AddSecurityVotersPassTest extends TestCase
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @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.
|
||||
* @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.
|
||||
*/
|
||||
public function testVoterMissingInterface()
|
||||
{
|
||||
|
@ -125,7 +125,7 @@ class SecurityExtensionTest extends TestCase
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @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.
|
||||
* @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.
|
||||
*/
|
||||
public function testDeprecationForUserLogout()
|
||||
{
|
||||
|
Reference in New Issue
Block a user