Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
frknasir authored and actions-user committed Apr 9, 2022
1 parent 2b78a0d commit 4a1d8db
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
10 changes: 4 additions & 6 deletions src/HasRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

namespace StarfolkSoftware\Persona;

use StarfolkSoftware\Persona\Role;
use Illuminate\Support\Str;
use StarfolkSoftware\Persona\Persona;

trait HasRole
{
/**
* Returns the user's role.
*
*
* @return \StarfolkSoftware\Persona\Role
*/
public function role(): Role
Expand All @@ -22,7 +20,7 @@ public function role(): Role

/**
* Checks if the user has the given role.
*
*
* @param string $role
* @return bool
*/
Expand All @@ -33,7 +31,7 @@ public function hasRole(string $role): bool

/**
* Get the user's permissions.
*
*
* @return array
*/
public function permissions(): array
Expand All @@ -43,7 +41,7 @@ public function permissions(): array

/**
* Checks if the user has the given permission.
*
*
* @param string $permission
* @return bool
*/
Expand Down
6 changes: 3 additions & 3 deletions src/Persona.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class Persona

/**
* Checks if app has registered roles.
*
*
* @return bool
*/
public static function hasRoles(): bool
Expand All @@ -30,7 +30,7 @@ public static function hasRoles(): bool

/**
* Checks if app has registered permissions.
*
*
* @return bool
*/
public static function hasPermissions(): bool
Expand Down Expand Up @@ -80,7 +80,7 @@ public static function permissions(array $permissions)
{
static::$permissions = $permissions;

return new static;
return new static();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Models/UserWithRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ class UserWithRole extends User
use HasRole;

protected $table = 'users';
}
}
3 changes: 1 addition & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace StarfolkSoftware\Persona\Tests;

use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Database\Schema\Blueprint;
use Orchestra\Testbench\TestCase as Orchestra;
use StarfolkSoftware\Persona\PersonaServiceProvider;
use StarfolkSoftware\Persona\Tests\Models\UserWithRole;
Expand Down Expand Up @@ -51,7 +50,7 @@ public function getEnvironmentSetUp($app)
'products:update',
'products:delete',
],
]
],
]);
}

Expand Down

0 comments on commit 4a1d8db

Please sign in to comment.