We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2069794 commit 5b62cf7Copy full SHA for 5b62cf7
Voter/GateKeeper.php
@@ -76,14 +76,14 @@ public function supportsClass($class)
76
*/
77
public function vote(TokenInterface $token, $object, array $attributes)
78
{
79
- if (1 !== count($attributes))
+ if (false === $this->supportsAttribute($attributes[0]))
80
81
- throw new \InvalidArgumentException('Only one attribute is allowed');
+ return self::ACCESS_ABSTAIN;
82
}
83
84
- if (false === $this->supportsAttribute($attributes[0]))
+ if (1 !== count($attributes))
85
86
- return self::ACCESS_ABSTAIN;
+ throw new \InvalidArgumentException('Only one attribute is allowed');
87
88
89
$user = $token->getUser() instanceof ObjectInterface ? $token->getUser() : null;
0 commit comments