-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d89a521
commit 44aef78
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
stubs/Symfony/Component/Security/Core/Authorization/Voter/Voter.stub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\Security\Core\Authorization\Voter; | ||
|
||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; | ||
|
||
/** | ||
* @template TAttribute of string | ||
* @template TSubject of mixed | ||
*/ | ||
abstract class Voter implements VoterInterface | ||
{ | ||
/** | ||
* Determines if the attribute and subject are supported by this voter. | ||
* | ||
* @param mixed $subject | ||
* | ||
* @phpstan-assert-if-true TSubject $subject | ||
* @phpstan-assert-if-true TAttribute $attribute | ||
* | ||
* @return bool | ||
*/ | ||
abstract protected function supports(string $attribute, $subject); | ||
|
||
/** | ||
* Perform a single access check operation on a given attribute, subject and token. | ||
* It is safe to assume that $attribute and $subject already passed the "supports()" method check. | ||
* | ||
* @phpstan-param TAttribute $attribute | ||
* @phpstan-param TSubject $subject | ||
* | ||
* @return bool | ||
*/ | ||
abstract protected function voteOnAttribute(string $attribute, $subject, TokenInterface $token); | ||
} |