Skip to content

A self-hosted media server and file management system

chore: lint coding style (pint)

aminnausin211176dcf6c9
diff --git a/app/Console/Commands/ResetDemo.php b/app/Console/Commands/ResetDemo.php
index 0f06ed9a..142358d7 100644
--- a/app/Console/Commands/ResetDemo.php
+++ b/app/Console/Commands/ResetDemo.php
@@ -24,8 +24,9 @@ class ResetDemo extends Command {
* Execute the console command.
*/
public function handle() {
- if (!str_contains(strtolower(config('database.connections.pgsql.database', 'mediaServer')), 'demo')) {
- $this->error("Not using a demo database");
+ if (! str_contains(strtolower(config('database.connections.pgsql.database', 'mediaServer')), 'demo')) {
+ $this->error('Not using a demo database');
+
return;
}
$this->info('Resetting demo database...');
@@ -33,7 +34,7 @@ class ResetDemo extends Command {
Artisan::call('migrate:fresh', ['--force' => true]);
Artisan::call('db:seed', [
'--class' => 'DemoSeeder',
- '--force' => true
+ '--force' => true,
]);
Artisan::call('mediaServer:scan', ['library_id' => 1]);
diff --git a/app/Console/Commands/ScanFilesCommand.php b/app/Console/Commands/ScanFilesCommand.php
index 7592565b..8e9d0eb5 100644
--- a/app/Console/Commands/ScanFilesCommand.php
+++ b/app/Console/Commands/ScanFilesCommand.php
@@ -6,7 +6,6 @@ use App\Jobs\IndexFiles;
use App\Jobs\SyncFiles;
use App\Models\Category;
use App\Services\FileJobService;
-use App\Services\TaskService;
use Illuminate\Console\Command;
class ScanFilesCommand extends Command {
diff --git a/app/Jobs/ScheduledIndexFiles.php b/app/Jobs/ScheduledIndexFiles.php
index 15dd5b43..8ea7d6bb 100644
--- a/app/Jobs/ScheduledIndexFiles.php
+++ b/app/Jobs/ScheduledIndexFiles.php
@@ -2,7 +2,6 @@
namespace App\Jobs;
-use App\Enums\TaskStatus;
use App\Services\FileJobService;
use App\Services\TaskService;
use Illuminate\Contracts\Queue\ShouldQueue;
@@ -10,7 +9,6 @@ use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Foundation\Queue\Queueable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
-use Illuminate\Support\Facades\Log;
class ScheduledIndexFiles implements ShouldQueue {
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
diff --git a/app/Services/FileJobService.php b/app/Services/FileJobService.php
index c82ef406..2c9c35e4 100644
--- a/app/Services/FileJobService.php
+++ b/app/Services/FileJobService.php
@@ -20,8 +20,7 @@ use Illuminate\Support\Facades\Bus;
use Illuminate\Support\Facades\Log;
class FileJobService {
- public function __construct(protected TaskService $taskService) {
- }
+ public function __construct(protected TaskService $taskService) {}
public function scanFiles(array $data, ?Category $category = null) {
$name = 'Scan Files';
@@ -146,7 +145,7 @@ class FileJobService {
$query = Folder::orderBy('id');
if ($category) {
- $query->whereHas('category', fn($q) => $q->where('id', $category->id))
+ $query->whereHas('category', fn ($q) => $q->where('id', $category->id))
->with('category');
}
@@ -286,9 +285,9 @@ class FileJobService {
public function setupBatch(array $chain, Task $task, ?callable $callback = null, ?array $taskData = []) {
return Bus::batch($chain)
- ->catch(fn(Batch $batch, \Throwable $e) => $this->handleOperationFailure($task, $e))
- ->finally(fn(Batch $batch) => $this->finalizeBatch($batch, $task, $callback))
- ->before(fn(Batch $batch) => $this->taskService->updateTask($task->id, array_merge([
+ ->catch(fn (Batch $batch, \Throwable $e) => $this->handleOperationFailure($task, $e))
+ ->finally(fn (Batch $batch) => $this->finalizeBatch($batch, $task, $callback))
+ ->before(fn (Batch $batch) => $this->taskService->updateTask($task->id, array_merge([
'status' => TaskStatus::PROCESSING,
'started_at' => $task->started_at ?? now(),
'batch_id' => $batch->id,
diff --git a/database/factories/SubtaskFactory.php b/database/factories/SubtaskFactory.php
index 051735b4..da19f9cf 100644
--- a/database/factories/SubtaskFactory.php
+++ b/database/factories/SubtaskFactory.php
@@ -7,15 +7,13 @@ use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Subtask>
*/
-class SubtaskFactory extends Factory
-{
+class SubtaskFactory extends Factory {
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
- public function definition(): array
- {
+ public function definition(): array {
return [
//
];
diff --git a/database/factories/TaskFactory.php b/database/factories/TaskFactory.php
index e4632799..816e7de7 100644
--- a/database/factories/TaskFactory.php
+++ b/database/factories/TaskFactory.php
@@ -7,15 +7,13 @@ use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Task>
*/
-class TaskFactory extends Factory
-{
+class TaskFactory extends Factory {
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
- public function definition(): array
- {
+ public function definition(): array {
return [
//
];
diff --git a/database/seeders/DemoSeeder.php b/database/seeders/DemoSeeder.php
index 674f0e7a..f5a67170 100644
--- a/database/seeders/DemoSeeder.php
+++ b/database/seeders/DemoSeeder.php
@@ -6,7 +6,6 @@ use App\Models\Metadata;
use App\Models\Record;
use App\Models\Tag;
use App\Models\User;
-use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;