@@ -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(DefaultProxyClassNameResolver::getClass($modelOrResource), $modelOrResource); |
| 114 | 114 | $role = $this->getCurrentRole(); |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | return false; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - private function getCurrentRole(): MultipleRoles|string |
|
| 137 | + private function getCurrentRole(): MultipleRoles | string |
|
| 138 | 138 | { |
| 139 | 139 | $user = CurrentUser::get(); |
| 140 | 140 | if (!$user) { |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | return $user->getRole(); |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - private function buildMessage(ModelResource|string $resource, ?string $privilege, MultipleRoles|string $role, bool $isAllowed): ?string |
|
| 147 | + private function buildMessage(ModelResource | string $resource, ?string $privilege, MultipleRoles | string $role, bool $isAllowed): ?string |
|
| 148 | 148 | { |
| 149 | 149 | if ($isAllowed) { |
| 150 | 150 | return null; |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | * |
| 186 | 186 | * @return array<array{resource:string, privileges: array<int, array{privilege:null|string, allowed: bool, allowIf: string[], denyIf: string[]}>}> |
| 187 | 187 | */ |
| 188 | - public function show(MultipleRoles|string $role, bool $useTranslations = true): array |
|
| 188 | + public function show(MultipleRoles | string $role, bool $useTranslations = true): array |
|
| 189 | 189 | { |
| 190 | 190 | $result = []; |
| 191 | 191 | /** @var string[] $resources */ |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | * |
| 36 | 36 | * @param null|array{host?: string, port?: int, user?: ?string, password?: ?string, connection_config?: array{username?: ?string, password?: ?string}}|string $configSmtp |
| 37 | 37 | */ |
| 38 | - public static function dsn(null|array|string $configSmtp): string |
|
| 38 | + public static function dsn(null | array | string $configSmtp): string |
|
| 39 | 39 | { |
| 40 | 40 | if (!$configSmtp) { |
| 41 | 41 | return 'null://null'; |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | return parent::query($sql); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - public function exec(string $sql): int|string |
|
| 36 | + public function exec(string $sql): int | string |
|
| 37 | 37 | { |
| 38 | 38 | _log()->debug($sql); |
| 39 | 39 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | /** |
| 13 | 13 | * @dataProvider providerDsn |
| 14 | 14 | */ |
| 15 | - public function testDsn(null|array|string $input, string $expected): void |
|
| 15 | + public function testDsn(null | array | string $input, string $expected): void |
|
| 16 | 16 | { |
| 17 | 17 | $actual = TransportFactory::dsn($input); |
| 18 | 18 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | private Collection $posts; |
| 30 | 30 | |
| 31 | 31 | public function __construct( |
| 32 | - private MultipleRoles|string $role = 'member', |
|
| 32 | + private MultipleRoles | string $role = 'member', |
|
| 33 | 33 | ) {} |
| 34 | 34 | |
| 35 | 35 | public function getName(): string |
@@ -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 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | return parent::deny($roles, $resources, $privileges, $assert); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - private function storePrivileges(null|string|array|ResourceInterface $resource, null|string|array $privileges): void |
|
| 81 | + private function storePrivileges(null | string | array | ResourceInterface $resource, null | string | array $privileges): void |
|
| 82 | 82 | { |
| 83 | 83 | if (!is_array($resource)) { |
| 84 | 84 | $resource = [$resource]; |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | * |
| 188 | 188 | * @return array{privilege: null|string, allowed: bool, allowIf: string[], denyIf: string[]} |
| 189 | 189 | */ |
| 190 | - public function show(null|RoleInterface|string $role, null|ResourceInterface|string $resource, ?string $privilege): array |
|
| 190 | + public function show(null | RoleInterface | string $role, null | ResourceInterface | string $resource, ?string $privilege): array |
|
| 191 | 191 | { |
| 192 | 192 | $allowed = $this->isAllowed($role, $resource, $privilege); |
| 193 | 193 | sort($this->usedAllowAssertions); |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | private readonly ?string $configurationTableName, |
| 23 | 23 | ) {} |
| 24 | 24 | |
| 25 | - public function __invoke(AbstractAsset|string $asset): bool |
|
| 25 | + public function __invoke(AbstractAsset | string $asset): bool |
|
| 26 | 26 | { |
| 27 | 27 | if (!$this->enabled) { |
| 28 | 28 | return true; |