1 | <?php |
||
8 | class WildcardPermission |
||
9 | { |
||
10 | /** @var string */ |
||
11 | const WILDCARD_TOKEN = '*'; |
||
12 | |||
13 | /** @var string */ |
||
14 | const PART_DELIMITER = '.'; |
||
15 | |||
16 | /** @var string */ |
||
17 | const SUBPART_DELIMITER = ','; |
||
18 | |||
19 | /** @var string */ |
||
20 | protected $permission; |
||
21 | |||
22 | /** @var Collection */ |
||
23 | protected $parts; |
||
24 | |||
25 | /** |
||
26 | * @param string $permission |
||
27 | */ |
||
28 | public function __construct(string $permission) |
||
35 | |||
36 | /** |
||
37 | * @param string|WildcardPermission $permission |
||
38 | * |
||
39 | * @return bool |
||
40 | */ |
||
41 | public function implies($permission): bool |
||
71 | |||
72 | /** |
||
73 | * @param Collection $part |
||
74 | * @param Collection $otherPart |
||
75 | * |
||
76 | * @return bool |
||
77 | */ |
||
78 | protected function containsAll(Collection $part, Collection $otherPart): bool |
||
88 | |||
89 | /** |
||
90 | * @return Collection |
||
91 | */ |
||
92 | public function getParts(): Collection |
||
96 | |||
97 | /** |
||
98 | * Sets the different parts and subparts from permission string. |
||
99 | * |
||
100 | * @return void |
||
101 | */ |
||
102 | protected function setParts(): void |
||
124 | } |
||
125 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.