Skip to content

Commit

Permalink
minor #24920 [SecurityBundle] Add missing quotes in deprecation messa…
Browse files Browse the repository at this point in the history
…ges (nicolas-grekas)

This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] Add missing quotes in deprecation messages

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Quotes in deprecation messages allow prettier display in the profiler panel (quoted strings are in bold).
We should be more careful when writing/merging deprecation messages, as there are much more that are missing useful quotes (help welcomed, starting from 3.3).

Commits
-------

6dd62e5 [SecurityBundle] Add missing quotes in deprecation messages
  • Loading branch information
Robin Chalas committed Nov 11, 2017
2 parents f1a1181 + 6dd62e5 commit 054e07f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Expand Up @@ -46,7 +46,7 @@ public function process(ContainerBuilder $container)
$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 %1$s is deprecated as of 3.4 and will be removed in 4.0. Implement the %1$s 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 be removed in 4.0. Implement the interface instead.', VoterInterface::class), E_USER_DEPRECATED);
}

if (!method_exists($class, 'vote')) {
Expand Down
Expand Up @@ -28,7 +28,7 @@ class HttpDigestFactory implements SecurityFactoryInterface
public function __construct($triggerDeprecation = true)
{
if ($triggerDeprecation) {
@trigger_error(sprintf('The %s class and the whole HTTP digest authentication system is deprecated since 3.4 and will be removed in 4.0.', __CLASS__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s" class and the whole HTTP digest authentication system is deprecated since 3.4 and will be removed in 4.0.', __CLASS__), E_USER_DEPRECATED);
}
}

Expand Down
Expand Up @@ -280,7 +280,7 @@ private function createFirewalls($config, ContainerBuilder $container)
}

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 logout_on_user_change to true in your firewall configuration.', E_USER_DEPRECATED);
@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);
}

$contextListenerDefinition->addMethodCall('setLogoutOnUserChange', array($firewall['logout_on_user_change']));
Expand Down
Expand Up @@ -72,7 +72,7 @@ public function testThatSecurityVotersAreProcessedInPriorityOrder()

/**
* @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 Symfony\Component\Security\Core\Authorization\Voter\VoterInterface 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 be removed in 4.0. Implement the interface instead.
*/
public function testVoterMissingInterface()
{
Expand Down
Expand Up @@ -125,7 +125,7 @@ public function testDisableRoleHierarchyVoter()

/**
* @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 logout_on_user_change to true in your firewall configuration.
* @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.
*/
public function testDeprecationForUserLogout()
{
Expand Down

0 comments on commit 054e07f

Please sign in to comment.