You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
newExpressionFunction('has_role', function ($role) {
58
+
@trigger_error('Using the "has_role()" function in security expressions is deprecated since Symfony 4.2, use "is_granted()" instead.', E_USER_DEPRECATED);
59
+
52
60
returnsprintf('in_array(%s, $roles)', $role);
53
61
}, function (array$variables, $role) {
62
+
@trigger_error('Using the "has_role()" function in security expressions is deprecated since Symfony 4.2, use "is_granted()" instead.', E_USER_DEPRECATED);
if ($authCheckerinstanceof RoleHierarchyInterface) {
41
+
@trigger_error(sprintf('Passing a RoleHierarchyInterface to "%s()" is deprecated since Symfony 4.2. Pass an AuthorizationCheckerInterface instead.', __METHOD__), E_USER_DEPRECATED);
42
+
$authChecker = $roleHierarchy;
43
+
} elseif (null === $authChecker) {
44
+
@trigger_error(sprintf('"%s()" expects an AuthorizationCheckerInterface as 3rd argument, not passing it is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
thrownew \InvalidArgumentException(sprintf('Argument 3 passed to %s() must be instance of %s or null, %s given.', __METHOD__, AuthorizationCheckerInterface::class, is_object($authChecker) ? get_class($authChecker) : gettype($authChecker)));
47
+
}
48
+
35
49
$this->expressionLanguage = $expressionLanguage;
36
50
$this->trustResolver = $trustResolver;
51
+
$this->authChecker = $authChecker;
37
52
$this->roleHierarchy = $roleHierarchy;
38
53
}
39
54
@@ -87,6 +102,7 @@ private function getVariables(TokenInterface $token, $subject)
0 commit comments