Skip to content

Commit 5fa731e

Browse files
committed
Sync "not implementing the method" deprecations messages
1 parent b0e05c8 commit 5fa731e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

Authentication/Token/Storage/TokenStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function getToken()
4040
public function setToken(TokenInterface $token = null)
4141
{
4242
if (null !== $token && !method_exists($token, 'getRoleNames')) {
43-
@trigger_error(sprintf('Not implementing the getRoleNames() method in %s which implements %s is deprecated since Symfony 4.3.', \get_class($token), TokenInterface::class), E_USER_DEPRECATED);
43+
@trigger_error(sprintf('Not implementing the "%s::getRoleNames()" method in "%s" is deprecated since Symfony 4.3.', TokenInterface::class, \get_class($token)), E_USER_DEPRECATED);
4444
}
4545

4646
$this->token = $token;

Authorization/Voter/ExpressionVoter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(ExpressionLanguage $expressionLanguage, Authenticati
4444
$authChecker = null;
4545

4646
if (!method_exists($roleHierarchy, 'getReachableRoleNames')) {
47-
@trigger_error(sprintf('Not implementing the getReachableRoleNames() method in %s which implements %s is deprecated since Symfony 4.3.', \get_class($this->roleHierarchy), RoleHierarchyInterface::class), E_USER_DEPRECATED);
47+
@trigger_error(sprintf('Not implementing the "%s::getReachableRoleNames()" method in "%s" is deprecated since Symfony 4.3.', RoleHierarchyInterface::class, \get_class($this->roleHierarchy)), E_USER_DEPRECATED);
4848
}
4949
} elseif (null === $authChecker) {
5050
@trigger_error(sprintf('Argument 3 passed to "%s()" should be an instance of AuthorizationCheckerInterface, not passing it is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
@@ -99,7 +99,7 @@ private function getVariables(TokenInterface $token, $subject)
9999
$roleNames = $token->getRoleNames();
100100
$roles = array_map(function (string $role) { return new Role($role, false); }, $roleNames);
101101
} else {
102-
@trigger_error(sprintf('Not implementing the getRoleNames() method in %s which implements %s is deprecated since Symfony 4.3.', \get_class($token), TokenInterface::class), E_USER_DEPRECATED);
102+
@trigger_error(sprintf('Not implementing the "%s::getRoleNames()" method in "%s" is deprecated since Symfony 4.3.', TokenInterface::class, \get_class($token)), E_USER_DEPRECATED);
103103

104104
$roles = $token->getRoles(false);
105105
$roleNames = array_map(function (Role $role) { return $role->getRole(); }, $roles);

Authorization/Voter/RoleHierarchyVoter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class RoleHierarchyVoter extends RoleVoter
2929
public function __construct(RoleHierarchyInterface $roleHierarchy, string $prefix = 'ROLE_')
3030
{
3131
if (!method_exists($roleHierarchy, 'getReachableRoleNames')) {
32-
@trigger_error(sprintf('Not implementing the getReachableRoleNames() method in %s which implements %s is deprecated since Symfony 4.3.', \get_class($roleHierarchy), RoleHierarchyInterface::class), E_USER_DEPRECATED);
32+
@trigger_error(sprintf('Not implementing the "%s::getReachableRoleNames()" method in "%s" is deprecated since Symfony 4.3.', RoleHierarchyInterface::class, \get_class($roleHierarchy)), E_USER_DEPRECATED);
3333
}
3434

3535
$this->roleHierarchy = $roleHierarchy;
@@ -46,7 +46,7 @@ protected function extractRoles(TokenInterface $token)
4646
if (method_exists($token, 'getRoleNames')) {
4747
$roles = $token->getRoleNames();
4848
} else {
49-
@trigger_error(sprintf('Not implementing the getRoleNames() method in %s which implements %s is deprecated since Symfony 4.3.', \get_class($token), TokenInterface::class), E_USER_DEPRECATED);
49+
@trigger_error(sprintf('Not implementing the "%s::getRoleNames()" method in "%s" is deprecated since Symfony 4.3.', TokenInterface::class, \get_class($token)), E_USER_DEPRECATED);
5050

5151
$roles = array_map(function (Role $role) { return $role->getRole(); }, $token->getRoles(false));
5252
}

Authorization/Voter/RoleVoter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ protected function extractRoles(TokenInterface $token)
6262
return $token->getRoleNames();
6363
}
6464

65-
@trigger_error(sprintf('Not implementing the getRoleNames() method in %s which implements %s is deprecated since Symfony 4.3.', \get_class($token), TokenInterface::class), E_USER_DEPRECATED);
65+
@trigger_error(sprintf('Not implementing the "%s::getRoleNames()" method in "%s" is deprecated since Symfony 4.3.', TokenInterface::class, \get_class($token)), E_USER_DEPRECATED);
6666

6767
return array_map(function (Role $role) { return $role->getRole(); }, $token->getRoles(false));
6868
}

0 commit comments

Comments
 (0)