Skip to content

Commit 3764226

Browse files
SlimGeegithub-actions[bot]
authored andcommitted
Fix styling
1 parent 48a33b4 commit 3764226

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

src/Commands/GeneratePermissionsCommand.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
use Illuminate\Database\Eloquent\Model;
77
use Illuminate\Support\Collection;
88
use Illuminate\Support\Facades\File;
9-
use Illuminate\Support\Facades\Storage;
109
use Illuminate\Support\Str;
1110
use ReflectionClass;
1211
use ReflectionException;
1312
use Spatie\Permission\Models\Permission;
1413
use SplFileInfo;
15-
use Symfony\Component\Filesystem\Filesystem;
1614

1715
class GeneratePermissionsCommand extends Command
1816
{
@@ -32,6 +30,7 @@ class GeneratePermissionsCommand extends Command
3230

3331
/**
3432
* Run the command.
33+
*
3534
* @return int
3635
*/
3736
public function handle(): int
@@ -58,21 +57,21 @@ protected function generatePermissionsForAllModels(): void
5857
{
5958
$models = $this->getModels();
6059

61-
$models->each(fn(string $model) => $this->generatePermissions($model));
60+
$models->each(fn (string $model) => $this->generatePermissions($model));
6261
}
6362

6463
/**
6564
* Generate permission for a given model.
6665
*
67-
* @param string $model
66+
* @param string $model
6867
* @return void
6968
*/
7069
public function generatePermissions(string $model): void
7170
{
7271
$permissions = config('authorizer.permissions');
7372

7473
collect($permissions)->each(
75-
fn(string $permission) => $this->generatePermission(
74+
fn (string $permission) => $this->generatePermission(
7675
$model,
7776
$permission
7877
)
@@ -86,12 +85,12 @@ public function generatePermission(string $model, string $permission)
8685
Str::contains($permission, 'all')
8786
) {
8887
return Permission::updateOrCreate([
89-
'name' => $permission . ' ' . Str::plural(Str::lower($model)),
88+
'name' => $permission.' '.Str::plural(Str::lower($model)),
9089
]);
9190
}
9291

9392
return Permission::updateOrCreate([
94-
'name' => $permission . ' ' . Str::lower($model),
93+
'name' => $permission.' '.Str::lower($model),
9594
]);
9695
}
9796

@@ -120,8 +119,8 @@ public function getModels(): array|Collection
120119
}
121120

122121
return $reflection->isSubclassOf(Model::class) &&
123-
!$reflection->isAbstract();
122+
! $reflection->isAbstract();
124123
})
125-
->map(fn($model) => Str::afterLast($model, '\\'));
124+
->map(fn ($model) => Str::afterLast($model, '\\'));
126125
}
127126
}

src/LaravelAuthorizerServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace FlixtechsLabs\LaravelAuthorizer;
44

55
use FlixtechsLabs\LaravelAuthorizer\Commands\GeneratePermissionsCommand;
6-
use Illuminate\Foundation\Console\AboutCommand;
76
use FlixtechsLabs\LaravelAuthorizer\Commands\LaravelAuthorizerCommand;
7+
use Illuminate\Foundation\Console\AboutCommand;
88
use Spatie\LaravelPackageTools\Package;
99
use Spatie\LaravelPackageTools\PackageServiceProvider;
1010

@@ -34,7 +34,7 @@ public function boot()
3434

3535
AboutCommand::add(
3636
'Laravel Authorizer',
37-
fn() => [
37+
fn () => [
3838
'version' => '0.0.1',
3939
'author' => 'Flixtechs Labs',
4040
'license' => 'MIT',

tests/GeneratePermissionsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
'Order',
1818
'OrderItem',
1919
])->each(
20-
fn($model) => $this->artisan('make:model', [
20+
fn ($model) => $this->artisan('make:model', [
2121
'name' => $model,
2222
])
2323
);
@@ -63,7 +63,7 @@
6363
'Order',
6464
'OrderItem',
6565
])->each(
66-
fn($model) => $this->artisan('make:model', [
66+
fn ($model) => $this->artisan('make:model', [
6767
'name' => $model,
6868
])
6969
);

0 commit comments

Comments
 (0)