@@ -15,7 +15,7 @@ |
||
15 | 15 | * |
16 | 16 | * @param class-string|object $object |
17 | 17 | */ |
18 | - public static function getShortClassName(object|string $object): string |
|
18 | + public static function getShortClassName(object | string $object): string |
|
19 | 19 | { |
20 | 20 | $reflect = new ReflectionClass($object); |
21 | 21 |
@@ -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 | ], |
@@ -51,7 +51,7 @@ |
||
51 | 51 | /** |
52 | 52 | * @return ExecutionResult|ExecutionResult[] |
53 | 53 | */ |
54 | - public function execute(ServerRequestInterface $request): array|ExecutionResult |
|
54 | + public function execute(ServerRequestInterface $request): array | ExecutionResult |
|
55 | 55 | { |
56 | 56 | if (!$request->getParsedBody()) { |
57 | 57 | /** @var array $parsedBody */ |
@@ -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 | } |
@@ -108,7 +108,7 @@ |
||
108 | 108 | /** |
109 | 109 | * @param ExecutionResult|ExecutionResult[] $result |
110 | 110 | */ |
111 | - private function resultToArray(array|ExecutionResult $result): array |
|
111 | + private function resultToArray(array | ExecutionResult $result): array |
|
112 | 112 | { |
113 | 113 | if (is_array($result)) { |
114 | 114 | foreach ($result as &$one) { |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | return parent::deny($roles, $resources, $privileges, $assert); |
76 | 76 | } |
77 | 77 | |
78 | - private function storePrivileges(null|string|array|ResourceInterface $resource, null|string|array $privileges): void |
|
78 | + private function storePrivileges(null | string | array | ResourceInterface $resource, null | string | array $privileges): void |
|
79 | 79 | { |
80 | 80 | if (!is_array($resource)) { |
81 | 81 | $resource = [$resource]; |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | * |
185 | 185 | * @return array{privilege: null|string, allowed: bool, allowIf: string[], denyIf: string[]} |
186 | 186 | */ |
187 | - public function show(null|RoleInterface|string $role, null|ResourceInterface|string $resource, null|string $privilege): array |
|
187 | + public function show(null | RoleInterface | string $role, null | ResourceInterface | string $resource, null | string $privilege): array |
|
188 | 188 | { |
189 | 189 | $allowed = $this->isAllowed($role, $resource, $privilege); |
190 | 190 | sort($this->usedAllowAssertions); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * |
109 | 109 | * This should be the main method to do all ACL checks. |
110 | 110 | */ |
111 | - public function isCurrentUserAllowed(Model|string $modelOrResource, string $privilege): bool |
|
111 | + public function isCurrentUserAllowed(Model | string $modelOrResource, string $privilege): bool |
|
112 | 112 | { |
113 | 113 | $resource = is_string($modelOrResource) ? $modelOrResource : new ModelResource($this->getClass($modelOrResource), $modelOrResource); |
114 | 114 | $role = $this->getCurrentRole(); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | return ClassUtils::getRealClass($resource::class); |
142 | 142 | } |
143 | 143 | |
144 | - private function getCurrentRole(): MultipleRoles|string |
|
144 | + private function getCurrentRole(): MultipleRoles | string |
|
145 | 145 | { |
146 | 146 | $user = CurrentUser::get(); |
147 | 147 | if (!$user) { |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | return $user->getRole(); |
152 | 152 | } |
153 | 153 | |
154 | - private function buildMessage(ModelResource|string $resource, ?string $privilege, MultipleRoles|string $role, bool $isAllowed): ?string |
|
154 | + private function buildMessage(ModelResource | string $resource, ?string $privilege, MultipleRoles | string $role, bool $isAllowed): ?string |
|
155 | 155 | { |
156 | 156 | if ($isAllowed) { |
157 | 157 | return null; |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | * |
192 | 192 | * @return array<array{resource:string, privileges: array<int, array{privilege:null|string, allowed: bool, allowIf: string[], denyIf: string[]}>}> |
193 | 193 | */ |
194 | - public function show(MultipleRoles|string $role, bool $useTranslations = true): array |
|
194 | + public function show(MultipleRoles | string $role, bool $useTranslations = true): array |
|
195 | 195 | { |
196 | 196 | $result = []; |
197 | 197 | /** @var string[] $resources */ |
@@ -22,7 +22,7 @@ |
||
22 | 22 | */ |
23 | 23 | class NativeIn extends FunctionNode |
24 | 24 | { |
25 | - private string|Node $field; |
|
25 | + private string | Node $field; |
|
26 | 26 | |
27 | 27 | private Literal $nativeQuery; |
28 | 28 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | #[ORM\OneToMany(targetEntity: 'EcodevTests\Felix\Blog\Model\Post', mappedBy: 'user')] |
29 | 29 | private Collection $posts; |
30 | 30 | |
31 | - public function __construct(private MultipleRoles|string $role = 'member') |
|
31 | + public function __construct(private MultipleRoles | string $role = 'member') |
|
32 | 32 | { |
33 | 33 | } |
34 | 34 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $this->name = $name; |
43 | 43 | } |
44 | 44 | |
45 | - public function getRole(): string|MultipleRoles |
|
45 | + public function getRole(): string | MultipleRoles |
|
46 | 46 | { |
47 | 47 | return $this->role; |
48 | 48 | } |