1 | <?php |
||
9 | final class RoleAuthorization implements AuthorizationInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var array |
||
13 | */ |
||
14 | private $roleHierarchyResolver; |
||
15 | |||
16 | /** |
||
17 | * @param RoleHierarchyResolverInterface $roleHierarchyResolver |
||
18 | */ |
||
19 | public function __construct(RoleHierarchyResolverInterface $roleHierarchyResolver) |
||
23 | |||
24 | /** |
||
25 | * @param UserInterface $user |
||
26 | * @param mixed $attributes |
||
27 | * @param OwnedByUserModelInterface|null $model |
||
28 | * |
||
29 | * @return bool |
||
30 | */ |
||
31 | public function isGranted(UserInterface $user, $attributes, OwnedByUserModelInterface $model = null): bool |
||
42 | |||
43 | /** |
||
44 | * @param UserInterface $user |
||
45 | * |
||
46 | * @return array |
||
47 | */ |
||
48 | private function getOwningRoles(UserInterface $user): array |
||
52 | |||
53 | /** |
||
54 | * @param mixed $attributes |
||
55 | * |
||
56 | * @return array |
||
57 | */ |
||
58 | private function getNeededRoles($attributes): array |
||
62 | |||
63 | /** |
||
64 | * @param array $owningRoles |
||
65 | * @param array $neededRoles |
||
66 | * |
||
67 | * @return bool |
||
68 | */ |
||
69 | private function checkRoles(array $owningRoles, array $neededRoles): bool |
||
79 | } |
||
80 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..