Skip to content

Commit c95c520

Browse files
Apply fixes from StyleCI (#662)
Co-authored-by: StyleCI Bot <bot@styleci.io>
1 parent 79a4154 commit c95c520

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Middleware/LaratrustMiddleware.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected function authorization(
3131
$method = $type == 'roles' ? 'hasRole' : 'hasPermission';
3232
$rolesPermissions = Helper::standardize($rolesPermissions, true);
3333

34-
return !Auth::guard($guard)->guest()
34+
return ! Auth::guard($guard)->guest()
3535
&& Auth::guard($guard)->user()->$method($rolesPermissions, $team, $requireAll);
3636
}
3737

@@ -50,7 +50,7 @@ protected function unauthorized(): mixed
5050
}
5151

5252
$redirect = Redirect::to($handler['url']);
53-
if (!empty($handler['message']['content'])) {
53+
if (! empty($handler['message']['content'])) {
5454
$redirect->with($handler['message']['key'], $handler['message']['content']);
5555
}
5656

@@ -63,12 +63,12 @@ protected function unauthorized(): mixed
6363
protected function getValuesFromParameters(?string $team, ?string $options): array
6464
{
6565
return [
66-
'team' => Str::contains((string)$team, ['require_all', 'guard:']) ? null : $team,
67-
'require_all' => Str::contains((string)$team, 'require_all') ?: Str::contains((string)$options, 'require_all'),
68-
'guard' => Str::contains((string)$team, 'guard:')
66+
'team' => Str::contains((string) $team, ['require_all', 'guard:']) ? null : $team,
67+
'require_all' => Str::contains((string) $team, 'require_all') ?: Str::contains((string) $options, 'require_all'),
68+
'guard' => Str::contains((string) $team, 'guard:')
6969
? $this->extractGuard($team)
7070
: (
71-
Str::contains((string)$options, 'guard:')
71+
Str::contains((string) $options, 'guard:')
7272
? $this->extractGuard($options)
7373
: Config::get('auth.defaults.guard')
7474
),
@@ -83,7 +83,7 @@ protected function extractGuard(string $string): string
8383
$options = Collection::make(explode('|', $string));
8484

8585
return $options
86-
->reject(fn ($option) => !Str::contains($option, 'guard:'))
86+
->reject(fn ($option) => ! Str::contains($option, 'guard:'))
8787
->map(fn ($option) => Str::of($option)->explode(':')->get(1))
8888
->first();
8989
}

0 commit comments

Comments
 (0)