Skip to content

Commit

Permalink
update styles
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafamaklad committed Mar 17, 2018
1 parent a0a643d commit ec07e57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/Guard.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

namespace Maklad\Permission;

use Illuminate\Support\Collection;
Expand Down
10 changes: 5 additions & 5 deletions src/Traits/HasRoles.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,16 @@ public function hasRole($roles): bool
$has_role = false;
if (\is_string($roles)) {
$has_role = $this->roles->contains('name', $roles);
}elseif ($roles instanceof Role) {
} elseif ($roles instanceof Role) {
$has_role = $this->roles->contains('id', $roles->id);
}elseif (\is_array($roles)) {
} elseif (\is_array($roles)) {
foreach ($roles as $role) {
if ($this->hasRole($role)) {
$has_role = true;
break;
}
}
}else {
} else {
$has_role = ! $roles->intersect($this->roles)->isEmpty();
}

Expand Down Expand Up @@ -206,9 +206,9 @@ public function hasAllRoles($roles): bool

if (\is_string($roles)) {
$has_roles = $this->roles->contains('name', $roles);
}elseif ($roles instanceof Role) {
} elseif ($roles instanceof Role) {
$has_roles = $this->roles->contains('id', $roles->id);
}else {
} else {
$roles = \collect()->make($roles)->map(function ($role) {
return $role instanceof Role ? $role->name : $role;
});
Expand Down

0 comments on commit ec07e57

Please sign in to comment.