Skip to content

Commit

Permalink
Fix infinite recursion when passed an empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
corphi committed Jan 26, 2019
1 parent afb7bb5 commit ab12ca8
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -42,7 +42,7 @@ class AccessDecisionManager implements AccessDecisionManagerInterface
*/
public function __construct($voters = [], $strategy = self::STRATEGY_AFFIRMATIVE, $allowIfAllAbstainDecisions = false, $allowIfEqualGrantedDeniedDecisions = true)
{
$strategyMethod = 'decide'.ucfirst($strategy);
$strategyMethod = 'doDecide'.ucfirst($strategy);
if (!\is_callable([$this, $strategyMethod])) {
throw new \InvalidArgumentException(sprintf('The strategy "%s" is not supported.', $strategy));
}
Expand Down Expand Up @@ -81,7 +81,7 @@ public function decide(TokenInterface $token, array $attributes, $object = null)
* If all voters abstained from voting, the decision will be based on the
* allowIfAllAbstainDecisions property value (defaults to false).
*/
private function decideAffirmative(TokenInterface $token, array $attributes, $object = null)
private function doDecideAffirmative(TokenInterface $token, array $attributes, $object = null)
{
$deny = 0;
foreach ($this->voters as $voter) {
Expand Down Expand Up @@ -121,7 +121,7 @@ private function decideAffirmative(TokenInterface $token, array $attributes, $ob
* If all voters abstained from voting, the decision will be based on the
* allowIfAllAbstainDecisions property value (defaults to false).
*/
private function decideConsensus(TokenInterface $token, array $attributes, $object = null)
private function doDecideConsensus(TokenInterface $token, array $attributes, $object = null)
{
$grant = 0;
$deny = 0;
Expand Down Expand Up @@ -162,7 +162,7 @@ private function decideConsensus(TokenInterface $token, array $attributes, $obje
* If all voters abstained from voting, the decision will be based on the
* allowIfAllAbstainDecisions property value (defaults to false).
*/
private function decideUnanimous(TokenInterface $token, array $attributes, $object = null)
private function doDecideUnanimous(TokenInterface $token, array $attributes, $object = null)
{
$grant = 0;
foreach ($this->voters as $voter) {
Expand Down

0 comments on commit ab12ca8

Please sign in to comment.