Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Feb 27, 2024
1 parent f7b0781 commit eec4dac
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Guard.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static function getNames($model): Collection
$guardName = $model->guard_name ?? null;
}

if (! isset($guardName)) {
if (!isset($guardName)) {
$class = is_object($model) ? get_class($model) : $model;

$guardName = (new \ReflectionClass($class))->getDefaultProperties()['guard_name'] ?? null;
Expand All @@ -32,7 +32,7 @@ public static function getNames($model): Collection

return collect(config('auth.guards'))
->map(function ($guard) {
if (! isset($guard['provider'])) {
if (!isset($guard['provider'])) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Http/Middleware/RoleMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function handle($request, Closure $next, $role)
? $role
: explode('|', $role);

if (! Auth::user()->hasAnyRole($roles)) {
if (!Auth::user()->hasAnyRole($roles)) {
throw UnauthorizedException::forRoles($roles);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Models/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static function findOrCreate(string $name, ?string $guardName = null): Pe

$permission = static::getPermissions()->where('name', $name)->where('guard_name', $guardName)->first();

if (! $permission) {
if (!$permission) {
return static::create(['name' => $name, 'guard_name' => $guardName]);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Traits/HasPermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected function getStoredPermissions(string|Permission ...$permissions): Coll
*/
protected function ensureModelSharesGuard(Role|Permission $roleOrPermission): void
{
if (! $this->getGuardNames()->contains($roleOrPermission->guard_name)) {
if (!$this->getGuardNames()->contains($roleOrPermission->guard_name)) {
throw GuardDoesNotMatch::create($roleOrPermission->guard_name, $this->getGuardNames());
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Traits/HasRoles.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ trait HasRoles
public static function bootHasRoles(): void
{
static::deleting(function ($model) {
if (method_exists($model, 'isForceDeleting') && ! $model->isForceDeleting()) {
if (method_exists($model, 'isForceDeleting') && !$model->isForceDeleting()) {
return;
}
$model->roles()->detach();
Expand Down Expand Up @@ -252,7 +252,7 @@ public function hasDirectPermission(string|Permission $permission): bool
if (is_string($permission)) {
$permission = PermissionProxy::findByName($permission, $this->getDefaultGuardName());

if (! $permission) {
if (!$permission) {
return false;
}
}
Expand Down Expand Up @@ -347,7 +347,7 @@ protected function convertPipeToArray(string $pipeString): string|array
return explode('|', $pipeString);
}

if (! in_array($quoteCharacter, ["'", '"'])) {
if (!in_array($quoteCharacter, ["'", '"'])) {
return explode('|', $pipeString);
}

Expand Down

0 comments on commit eec4dac

Please sign in to comment.