@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | private Collection $posts; |
| 39 | 39 | |
| 40 | - public function __construct(private MultipleRoles|string $role = 'member') |
|
| 40 | + public function __construct(private MultipleRoles | string $role = 'member') |
|
| 41 | 41 | { |
| 42 | 42 | } |
| 43 | 43 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $this->name = $name; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - public function getRole(): string|MultipleRoles |
|
| 54 | + public function getRole(): string | MultipleRoles |
|
| 55 | 55 | { |
| 56 | 56 | return $this->role; |
| 57 | 57 | } |
@@ -167,7 +167,7 @@ |
||
| 167 | 167 | self::assertSame( |
| 168 | 168 | [ |
| 169 | 169 | 'privilege' => 'non-existing-privilege', |
| 170 | - 'allowed' => true, // True because allowed via the `null` wildcard |
|
| 170 | + 'allowed' => true, // True because allowed via the `null` wildcard |
|
| 171 | 171 | 'allowIf' => [], |
| 172 | 172 | 'denyIf' => [], |
| 173 | 173 | ], |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | return parent::deny($roles, $resources, $privileges, $assert); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - private function storePrivileges(null|string|array $privileges): void |
|
| 73 | + private function storePrivileges(null | string | array $privileges): void |
|
| 74 | 74 | { |
| 75 | 75 | if (!is_array($privileges)) { |
| 76 | 76 | $privileges = [$privileges]; |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | * |
| 142 | 142 | * @return array{privilege: null|string, allowed: bool, allowIf: string[], denyIf: string[]} |
| 143 | 143 | */ |
| 144 | - public function show(null|RoleInterface|string $role, null|ResourceInterface|string $resource, null|string $privilege): array |
|
| 144 | + public function show(null | RoleInterface | string $role, null | ResourceInterface | string $resource, null | string $privilege): array |
|
| 145 | 145 | { |
| 146 | 146 | $allowed = $this->isAllowed($role, $resource, $privilege); |
| 147 | 147 | sort($this->usedAllowAssertions); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | return ClassUtils::getRealClass($resource::class); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - private function getCurrentRole(): MultipleRoles|string |
|
| 133 | + private function getCurrentRole(): MultipleRoles | string |
|
| 134 | 134 | { |
| 135 | 135 | $user = CurrentUser::get(); |
| 136 | 136 | if (!$user) { |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | return $user->getRole(); |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | - private function buildMessage(ModelResource $resource, ?string $privilege, MultipleRoles|string $role, bool $isAllowed): ?string |
|
| 143 | + private function buildMessage(ModelResource $resource, ?string $privilege, MultipleRoles | string $role, bool $isAllowed): ?string |
|
| 144 | 144 | { |
| 145 | 145 | if ($isAllowed) { |
| 146 | 146 | return null; |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | /** |
| 177 | 177 | * @return array<array{resource:string, privileges: array<int, array{privilege:null|string, allowed: bool, allowIf: string[], denyIf: string[]}>}> |
| 178 | 178 | */ |
| 179 | - public function show(MultipleRoles|string $role): array |
|
| 179 | + public function show(MultipleRoles | string $role): array |
|
| 180 | 180 | { |
| 181 | 181 | $result = []; |
| 182 | 182 | /** @var string[] $resources */ |
@@ -21,5 +21,5 @@ |
||
| 21 | 21 | /** |
| 22 | 22 | * Returns the user role. |
| 23 | 23 | */ |
| 24 | - public function getRole(): MultipleRoles|string; |
|
| 24 | + public function getRole(): MultipleRoles | string; |
|
| 25 | 25 | } |