Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Exceptions/RbacException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class RbacException extends Exception
{
/**
* @param \Illuminate\Support\Collection $abilities
*
* @return static
*/
public static function rbacContainsDuplicateAbilities(Collection $abilities): static
Expand All @@ -19,7 +20,8 @@ public static function rbacContainsDuplicateAbilities(Collection $abilities): st
->groupBy('value')
->filter(fn ($element) => $element->count() > 1)
->collapse()
->map(fn(BackedEnum $enum) => Str::of(get_class($enum))
->map(
fn (BackedEnum $enum) => Str::of(get_class($enum))
->classBasename()
->append(':', $enum->value)
);
Expand Down
1 change: 0 additions & 1 deletion src/Jobs/ResetPermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use BackedEnum;
use BinaryCats\LaravelRbac\Actions\StorePermission;
use BinaryCats\LaravelRbac\DiscoverAbilities;
use BinaryCats\LaravelRbac\Facades\Rbac;
use Illuminate\Bus\Queueable;
use Illuminate\Foundation\Bus\Dispatchable;
Expand Down
10 changes: 5 additions & 5 deletions src/Rbac.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

class Rbac
{
/** @var string */
/** @var string */
protected string $abilitiesPath;

/** @var string */
/** @var string */
protected string $basePath;

/** @var \Illuminate\Support\Collection|null */
/** @var \Illuminate\Support\Collection|null */
protected ?Collection $abilities = null;

/**
Expand All @@ -26,7 +26,7 @@ public function __construct(string $abilitiesPath, string $basePath)
}

/**
* Return the list of all abilities in the application
* Return the list of all abilities in the application.
*/
public function abilities(): Collection
{
Expand All @@ -38,7 +38,7 @@ public function abilities(): Collection
}

/**
* Discover Abilities in path
* Discover Abilities in path.
*/
protected function discoverAbilities(): Collection
{
Expand Down
2 changes: 1 addition & 1 deletion src/RbacServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function configurePackage(Package $package): void
*/
public function packageRegistered()
{
$this->app->bind(Rbac::class, function(Application $app) {
$this->app->bind(Rbac::class, function (Application $app) {
return new Rbac(
abilitiesPath: $app['config']->get('rbac.path'),
basePath: $app->basePath()
Expand Down