1 | <?php |
||
11 | class PassportControl |
||
12 | { |
||
13 | /** @var EntityManager */ |
||
14 | private $entityManager; |
||
15 | |||
16 | /** |
||
17 | * PassportControl constructor. |
||
18 | * @param EntityManager $entityManager |
||
19 | */ |
||
20 | public function __construct(EntityManager $entityManager) |
||
24 | |||
25 | /** |
||
26 | * @param PassportInterface $passport |
||
27 | * @param ResourceInterface $resource |
||
28 | * @return bool |
||
29 | */ |
||
30 | public function isAuthorized(PassportInterface $passport, ResourceInterface $resource): bool |
||
34 | |||
35 | /** |
||
36 | * @param PassportInterface $passport |
||
37 | * @param RoleInterface $role |
||
38 | * @param ResourceInterface $resource |
||
39 | * @return bool |
||
40 | */ |
||
41 | public function grantEntitlement(PassportInterface $passport, RoleInterface $role, ResourceInterface $resource = null): bool |
||
54 | |||
55 | /** |
||
56 | * @param PassportInterface $passport |
||
57 | * @param RoleInterface $role |
||
58 | * @param ResourceInterface $resource |
||
59 | * @return bool |
||
60 | */ |
||
61 | public function revokeEntitlement(PassportInterface $passport, RoleInterface $role, ResourceInterface $resource): bool |
||
65 | |||
66 | /** |
||
67 | * @param int $userId |
||
68 | * @return PassportInterface |
||
69 | */ |
||
70 | public function createNewRole(RoleInterface $role): RoleInterface |
||
77 | |||
78 | /** |
||
79 | * @param int $userId |
||
80 | * @return PassportInterface |
||
81 | */ |
||
82 | public function removeRole(RoleInterface $role): void |
||
87 | |||
88 | /** |
||
89 | * @param string $name |
||
90 | * @return Role|null |
||
91 | */ |
||
92 | public function findRole(string $name): ?Role |
||
98 | |||
99 | /** |
||
100 | * @param string $name |
||
101 | * @param int $id |
||
102 | * @return PassportRole|null |
||
103 | */ |
||
104 | public function findPassportRole(string $name, int $id, int $entityId = null): ?PassportRole |
||
117 | |||
118 | /** |
||
119 | * @param int $id |
||
120 | * @return Passport |
||
121 | */ |
||
122 | public function findUserPassport(int $id): Passport |
||
130 | } |
||
131 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.