|
11 | 11 |
|
12 | 12 | namespace Symfony\Component\Security\Core\Authorization; |
13 | 13 |
|
14 | | -use Symfony\Component\Security\Core\Authorization\Voter\Vote; |
15 | | -use Symfony\Component\Security\Core\Authorization\Voter\Voter; |
| 14 | +use Symfony\Component\Security\Core\Authorization\Voter\VoteInterface; |
16 | 15 | use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; |
17 | 16 |
|
18 | 17 | /** |
|
24 | 23 | final class AccessDecision |
25 | 24 | { |
26 | 25 | /** |
27 | | - * @param int $access One of the VoterInterface constants (ACCESS_GRANTED, ACCESS_ABSTAIN, ACCESS_DENIED) |
28 | | - * @param Vote[] $votes |
| 26 | + * @param int $access One of the VoterInterface constants (ACCESS_GRANTED, ACCESS_ABSTAIN, ACCESS_DENIED) |
| 27 | + * @param VoteInterface[] $votes |
29 | 28 | */ |
30 | 29 | public function __construct( |
31 | 30 | private readonly int $access, |
@@ -60,42 +59,42 @@ public function getMessage(): string |
60 | 59 | } |
61 | 60 |
|
62 | 61 | /** |
63 | | - * @return Vote[] |
| 62 | + * @return VoteInterface[] |
64 | 63 | */ |
65 | 64 | public function getVotes(): array |
66 | 65 | { |
67 | 66 | return $this->votes; |
68 | 67 | } |
69 | 68 |
|
70 | 69 | /** |
71 | | - * @return Vote[] |
| 70 | + * @return VoteInterface[] |
72 | 71 | */ |
73 | 72 | public function getGrantedVotes(): array |
74 | 73 | { |
75 | | - return $this->getVotesByAccess(Voter::ACCESS_GRANTED); |
| 74 | + return $this->getVotesByAccess(VoterInterface::ACCESS_GRANTED); |
76 | 75 | } |
77 | 76 |
|
78 | 77 | /** |
79 | | - * @return Vote[] |
| 78 | + * @return VoteInterface[] |
80 | 79 | */ |
81 | 80 | public function getAbstainedVotes(): array |
82 | 81 | { |
83 | | - return $this->getVotesByAccess(Voter::ACCESS_ABSTAIN); |
| 82 | + return $this->getVotesByAccess(VoterInterface::ACCESS_ABSTAIN); |
84 | 83 | } |
85 | 84 |
|
86 | 85 | /** |
87 | | - * @return Vote[] |
| 86 | + * @return VoteInterface[] |
88 | 87 | */ |
89 | 88 | public function getDeniedVotes(): array |
90 | 89 | { |
91 | | - return $this->getVotesByAccess(Voter::ACCESS_DENIED); |
| 90 | + return $this->getVotesByAccess(VoterInterface::ACCESS_DENIED); |
92 | 91 | } |
93 | 92 |
|
94 | 93 | /** |
95 | | - * @return Vote[] |
| 94 | + * @return VoteInterface[] |
96 | 95 | */ |
97 | 96 | private function getVotesByAccess(int $access): array |
98 | 97 | { |
99 | | - return array_filter($this->votes, static fn (Vote $vote): bool => $vote->getAccess() === $access); |
| 98 | + return array_filter($this->votes, static fn (VoteInterface $vote): bool => $vote->getAccess() === $access); |
100 | 99 | } |
101 | 100 | } |
0 commit comments