1 | <?php |
||
9 | class PassportControl |
||
10 | { |
||
11 | /** @var EntityManager */ |
||
12 | private $entityManager; |
||
13 | |||
14 | /** |
||
15 | * PassportControl constructor. |
||
16 | * @param EntityManager $entityManager |
||
17 | */ |
||
18 | public function __construct(EntityManager $entityManager) |
||
22 | |||
23 | /** |
||
24 | * @param PassportInterface $passport |
||
25 | * @param ActionInterface $action |
||
26 | * @param ResourceInterface $resource |
||
27 | * @return bool |
||
28 | */ |
||
29 | public function isAuthorized(PassportInterface $passport, ActionInterface $action, ResourceInterface $resource): bool |
||
33 | |||
34 | /** |
||
35 | * @param PassportInterface $passport |
||
36 | * @param RoleInterface $role |
||
37 | * @param ResourceInterface $resource |
||
38 | * @return bool |
||
39 | */ |
||
40 | public function grantEntitlement(PassportInterface $passport, RoleInterface $role, ResourceInterface $resource): bool |
||
44 | |||
45 | /** |
||
46 | * @param PassportInterface $passport |
||
47 | * @param RoleInterface $role |
||
48 | * @param ResourceInterface $resource |
||
49 | * @return bool |
||
50 | */ |
||
51 | public function revokeEntitlement(PassportInterface $passport, RoleInterface $role, ResourceInterface $resource): bool |
||
55 | |||
56 | /** |
||
57 | * @param int $userId |
||
58 | * @return PassportInterface |
||
59 | */ |
||
60 | public function createNewPassport(int $userId): PassportInterface |
||
66 | |||
67 | /** |
||
68 | * @param int $userId |
||
69 | * @return PassportInterface |
||
70 | */ |
||
71 | public function createNewRole(RoleInterface $role): RoleInterface |
||
78 | |||
79 | /** |
||
80 | * @param int $userId |
||
81 | * @return PassportInterface |
||
82 | */ |
||
83 | public function removeRole(RoleInterface $role): void |
||
88 | |||
89 | /** |
||
90 | * @param string $name |
||
91 | * @return Role|null |
||
92 | */ |
||
93 | public function findRole(string $name): ?Role |
||
99 | } |
||
100 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.