minor #35447 [Security] suggest a non-deprecated function replacement (xabbuh)
This PR was merged into the 4.4 branch.
Discussion
----------
[Security] suggest a non-deprecated function replacement
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix #35437
| License | MIT
| Doc PR |
Commits
-------
731730fe2f
suggest a non-deprecated function replacement
This commit is contained in:
commit
c08fabebe7
@ -58,7 +58,7 @@ class AccessDecisionManager implements AccessDecisionManagerInterface
|
|||||||
public function decide(TokenInterface $token, array $attributes, $object = null)
|
public function decide(TokenInterface $token, array $attributes, $object = null)
|
||||||
{
|
{
|
||||||
if (\count($attributes) > 1) {
|
if (\count($attributes) > 1) {
|
||||||
@trigger_error(sprintf('Passing more than one Security attribute to %s() is deprecated since Symfony 4.4. Use multiple decide() calls or the expression language (e.g. "has_role(...) or has_role(...)") instead.', __METHOD__), E_USER_DEPRECATED);
|
@trigger_error(sprintf('Passing more than one Security attribute to %s() is deprecated since Symfony 4.4. Use multiple decide() calls or the expression language (e.g. "is_granted(...) or is_granted(...)") instead.', __METHOD__), E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->{$this->strategy}($token, $attributes, $object);
|
return $this->{$this->strategy}($token, $attributes, $object);
|
||||||
|
@ -56,7 +56,7 @@ class AuthorizationChecker implements AuthorizationCheckerInterface
|
|||||||
if (!\is_array($attributes)) {
|
if (!\is_array($attributes)) {
|
||||||
$attributes = [$attributes];
|
$attributes = [$attributes];
|
||||||
} else {
|
} else {
|
||||||
@trigger_error(sprintf('Passing an array of Security attributes to %s() is deprecated since Symfony 4.4. Use multiple isGranted() calls or the expression language (e.g. "has_role(...) or has_role(...)") instead.', __METHOD__), E_USER_DEPRECATED);
|
@trigger_error(sprintf('Passing an array of Security attributes to %s() is deprecated since Symfony 4.4. Use multiple isGranted() calls or the expression language (e.g. "is_granted(...) or is_granted(...)") instead.', __METHOD__), E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->accessDecisionManager->decide($token, $attributes, $subject);
|
return $this->accessDecisionManager->decide($token, $attributes, $subject);
|
||||||
|
Reference in New Issue
Block a user