Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a51b7fa

Browse filesBrowse files
Introduce stub for Voter
1 parent b5a10ce commit a51b7fa
Copy full SHA for a51b7fa

File tree

Expand file treeCollapse file tree

1 file changed

+10
-1
lines changed
Filter options
  • src/Symfony/Component/Security/Core/Authorization/Voter
Expand file treeCollapse file tree

1 file changed

+10
-1
lines changed

‎src/Symfony/Component/Security/Core/Authorization/Voter/Voter.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authorization/Voter/Voter.php
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
*
1919
* @author Roman Marintšenko <inoryy@gmail.com>
2020
* @author Grégoire Pineau <lyrixx@lyrixx.info>
21+
*
22+
* @template TAttribute of string
23+
* @template TSubject of mixed
2124
*/
2225
abstract class Voter implements VoterInterface, CacheableVoterInterface
2326
{
@@ -74,13 +77,19 @@ public function supportsType(string $subjectType): bool
7477
/**
7578
* Determines if the attribute and subject are supported by this voter.
7679
*
77-
* @param $subject The subject to secure, e.g. an object the user wants to access or any other PHP type
80+
* @param mixed $subject The subject to secure, e.g. an object the user wants to access or any other PHP type
81+
*
82+
* @psalm-assert-if-true TSubject $subject
83+
* @psalm-assert-if-true TAttribute $attribute
7884
*/
7985
abstract protected function supports(string $attribute, mixed $subject): bool;
8086

8187
/**
8288
* Perform a single access check operation on a given attribute, subject and token.
8389
* It is safe to assume that $attribute and $subject already passed the "supports()" method check.
90+
*
91+
* @param TAttribute $attribute
92+
* @param TSubject $subject
8493
*/
8594
abstract protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool;
8695
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.