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
if (!is_callable(array($this, $strategyMethod))) {
@@ -58,9 +56,13 @@ public function __construct(array $voters = array(), $strategy = self::STRATEGY_
58
56
* Configures the voters.
59
57
*
60
58
* @param VoterInterface[] $voters An array of VoterInterface instances
59
+
*
60
+
* @deprecated since version 3.3, to be removed in 4.0. Pass the voters to the constructor instead.
61
61
*/
62
62
publicfunctionsetVoters(array$voters)
63
63
{
64
+
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Pass the voters to the constructor instead.', __METHOD__), E_USER_DEPRECATED);
$reflection = new \ReflectionProperty(AccessDecisionManager::class, 'voters');
41
+
$reflection->setAccessible(true);
42
+
$this->voters = $reflection->getValue($manager);
40
43
}
41
44
}
42
45
@@ -58,9 +61,13 @@ public function decide(TokenInterface $token, array $attributes, $object = null)
58
61
59
62
/**
60
63
* {@inheritdoc}
64
+
*
65
+
* @deprecated since version 3.3, to be removed in 4.0. Pass voters to the decorated AccessDecisionManager instead.
61
66
*/
62
67
publicfunctionsetVoters(array$voters)
63
68
{
69
+
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Pass voters to the decorated AccessDecisionManager instead.', __METHOD__), E_USER_DEPRECATED);
70
+
64
71
if (!method_exists($this->manager, 'setVoters')) {
0 commit comments