minor #34991 CS for AccessDecisionManager (aschempp)
This PR was merged into the 3.4 branch.
Discussion
----------
CS for AccessDecisionManager
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | #34548
| License | MIT
| Doc PR | -
As discussed in #34548 with @nicolas-grekas here's a CS change for the `AccessDecisionManager`
Commits
-------
b3742ec493
CS
This commit is contained in:
commit
ab8841e248
@ -86,17 +86,13 @@ class AccessDecisionManager implements AccessDecisionManagerInterface
|
|||||||
$deny = 0;
|
$deny = 0;
|
||||||
foreach ($this->voters as $voter) {
|
foreach ($this->voters as $voter) {
|
||||||
$result = $this->vote($voter, $token, $object, $attributes);
|
$result = $this->vote($voter, $token, $object, $attributes);
|
||||||
switch ($result) {
|
|
||||||
case VoterInterface::ACCESS_GRANTED:
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case VoterInterface::ACCESS_DENIED:
|
if (VoterInterface::ACCESS_GRANTED === $result) {
|
||||||
++$deny;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
if (VoterInterface::ACCESS_DENIED === $result) {
|
||||||
|
++$deny;
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,16 +124,10 @@ class AccessDecisionManager implements AccessDecisionManagerInterface
|
|||||||
foreach ($this->voters as $voter) {
|
foreach ($this->voters as $voter) {
|
||||||
$result = $this->vote($voter, $token, $object, $attributes);
|
$result = $this->vote($voter, $token, $object, $attributes);
|
||||||
|
|
||||||
switch ($result) {
|
if (VoterInterface::ACCESS_GRANTED === $result) {
|
||||||
case VoterInterface::ACCESS_GRANTED:
|
++$grant;
|
||||||
++$grant;
|
} elseif (VoterInterface::ACCESS_DENIED === $result) {
|
||||||
|
++$deny;
|
||||||
break;
|
|
||||||
|
|
||||||
case VoterInterface::ACCESS_DENIED:
|
|
||||||
++$deny;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,17 +159,12 @@ class AccessDecisionManager implements AccessDecisionManagerInterface
|
|||||||
foreach ($attributes as $attribute) {
|
foreach ($attributes as $attribute) {
|
||||||
$result = $this->vote($voter, $token, $object, [$attribute]);
|
$result = $this->vote($voter, $token, $object, [$attribute]);
|
||||||
|
|
||||||
switch ($result) {
|
if (VoterInterface::ACCESS_DENIED === $result) {
|
||||||
case VoterInterface::ACCESS_GRANTED:
|
return false;
|
||||||
++$grant;
|
}
|
||||||
|
|
||||||
break;
|
if (VoterInterface::ACCESS_GRANTED === $result) {
|
||||||
|
++$grant;
|
||||||
case VoterInterface::ACCESS_DENIED:
|
|
||||||
return false;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user