ExpressionVoter
in package
implements
CacheableVoterInterface
ExpressionVoter votes based on the evaluation of an expression.
Tags
Table of Contents
Interfaces
- CacheableVoterInterface
- Let voters expose the attributes and types they care about.
Properties
- $authChecker : mixed
- $expressionLanguage : mixed
- $roleHierarchy : mixed
- $trustResolver : mixed
Methods
- __construct() : mixed
- supportsAttribute() : bool
- supportsType() : bool
- vote() : int
- {@inheritdoc}
- getVariables() : array<string|int, mixed>
Properties
$authChecker
private
mixed
$authChecker
$expressionLanguage
private
mixed
$expressionLanguage
$roleHierarchy
private
mixed
$roleHierarchy
$trustResolver
private
mixed
$trustResolver
Methods
__construct()
public
__construct(ExpressionLanguage $expressionLanguage, AuthenticationTrustResolverInterface $trustResolver, AuthorizationCheckerInterface $authChecker[, RoleHierarchyInterface $roleHierarchy = null ]) : mixed
Parameters
- $expressionLanguage : ExpressionLanguage
- $trustResolver : AuthenticationTrustResolverInterface
- $authChecker : AuthorizationCheckerInterface
- $roleHierarchy : RoleHierarchyInterface = null
supportsAttribute()
public
supportsAttribute(string $attribute) : bool
Parameters
- $attribute : string
Return values
boolsupportsType()
public
supportsType(string $subjectType) : bool
Parameters
- $subjectType : string
-
The type of the subject inferred by
get_class
orget_debug_type
Return values
boolvote()
{@inheritdoc}
public
vote(TokenInterface $token, mixed $subject, array<string|int, mixed> $attributes) : int
Parameters
- $token : TokenInterface
- $subject : mixed
- $attributes : array<string|int, mixed>
Return values
intgetVariables()
private
getVariables(TokenInterface $token, mixed $subject) : array<string|int, mixed>
Parameters
- $token : TokenInterface
- $subject : mixed