1 | <?php |
||
11 | final class RoleAuthorization implements AuthorizationInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var array |
||
15 | */ |
||
16 | private $roleHierarchyResolver; |
||
17 | |||
18 | /** |
||
19 | * @var LoggerInterface |
||
20 | */ |
||
21 | private $logger; |
||
22 | |||
23 | /** |
||
24 | * @param RoleHierarchyResolverInterface $roleHierarchyResolver |
||
25 | */ |
||
26 | 3 | public function __construct(RoleHierarchyResolverInterface $roleHierarchyResolver, LoggerInterface $logger = null) |
|
31 | |||
32 | /** |
||
33 | * @param UserInterface $user |
||
34 | * @param mixed $attributes |
||
35 | * @param OwnedByUserModelInterface|null $model |
||
36 | * |
||
37 | * @return bool |
||
38 | */ |
||
39 | 3 | public function isGranted(UserInterface $user, $attributes, OwnedByUserModelInterface $model = null): bool |
|
62 | |||
63 | /** |
||
64 | * @param UserInterface $user |
||
65 | * |
||
66 | * @return array |
||
67 | */ |
||
68 | 3 | private function getOwningRoles(UserInterface $user): array |
|
72 | |||
73 | /** |
||
74 | * @param mixed $attributes |
||
75 | * |
||
76 | * @return array |
||
77 | */ |
||
78 | 3 | private function getNeededRoles($attributes): array |
|
82 | |||
83 | /** |
||
84 | * @param array $owningRoles |
||
85 | * @param array $neededRoles |
||
86 | * |
||
87 | * @return bool |
||
88 | */ |
||
89 | 3 | private function checkRoles(array $owningRoles, array $neededRoles): bool |
|
99 | } |
||
100 |
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..