private iterable
$voters;
private array
$votersCacheAttributes =
[];
private array
$votersCacheObject =
[];
private AccessDecisionStrategyInterface
$strategy;
/**
* @param iterable<mixed, VoterInterface> $voters An array or an iterator of VoterInterface instances
*/
public function __construct(iterable
$voters =
[], AccessDecisionStrategyInterface
$strategy = null
) { $this->voters =
$voters;
$this->strategy =
$strategy ??
new AffirmativeStrategy();
} /**
* @param bool $allowMultipleAttributes Whether to allow passing multiple values to the $attributes array
*/
public function decide(TokenInterface
$token, array
$attributes, mixed
$object = null, bool
$allowMultipleAttributes = false
): bool
{ // Special case for AccessListener, do not remove the right side of the condition before 6.0
if (\
count($attributes) > 1 && !
$allowMultipleAttributes) { throw new InvalidArgumentException(sprintf('Passing more than one Security attribute to "%s()" is not supported.', __METHOD__
));
}