From 820a7255176a2ffdfed011877cebce3644688d35 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Tue, 2 Jan 2024 01:28:49 +0100 Subject: [PATCH] Lint --- tests/Models/Post.php | 20 ++++++++++---------- tests/TestCase.php | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/Models/Post.php b/tests/Models/Post.php index 2f93853..5b18122 100644 --- a/tests/Models/Post.php +++ b/tests/Models/Post.php @@ -23,20 +23,20 @@ class Post extends Model implements HasMedia $this->addMediaCollection('defaultSingleFile')->maxWidth(fn () => 250)->singleFile(); $this->addMediaCollection('conversionsWithDefault') - ->singleFile() - ->withFallback(fn ($parent) => ['default.jpg', 'public']) - ->registerMediaConversions(function () { - $this->addMediaConversion('tiny')->width(200)->height(200); - }); + ->singleFile() + ->withFallback(fn ($parent) => ['default.jpg', 'public']) + ->registerMediaConversions(function () { + $this->addMediaConversion('tiny')->width(200)->height(200); + }); $this->addMediaCollection('images')->after(fn ($model) => Event::dispatch(new MediaChange($model))); $this->addMediaCollection('singleForced')->singleFile()->forceFileName(function ($model, $name) { - return $name.' '.now()->format('Y-m-d'); + return $name . ' ' . now()->format('Y-m-d'); }); $this->addMediaCollection('multipleForced')->forceFileName(function ($model, $name) { - return $name.' '.now()->format('Y-m-d'); + return $name . ' ' . now()->format('Y-m-d'); }); $this->addMediaCollection('singleStoringHook')->singleFile()->storing(function ($adder, $fileName) { @@ -49,8 +49,8 @@ class Post extends Model implements HasMedia $this->addMediaCollection('singleWithEvent')->singleFile()->stored(function (Media $media) { Event::dispatch(new MediaStored($media)); }) - ->destroyed(fn ($model) => Event::dispatch(new MediaDestroyed($model))) - ->after(fn ($model) => Event::dispatch(new MediaChange($model))); + ->destroyed(fn ($model) => Event::dispatch(new MediaDestroyed($model))) + ->after(fn ($model) => Event::dispatch(new MediaChange($model))); $this->addMediaCollection('multipleFilesWithEvent')->stored(function (Media $media) { Event::dispatch(new MediaStored($media)); @@ -61,6 +61,6 @@ class Post extends Model implements HasMedia ])->withPropertyValidation(fn ($path) => [ 'test' => 'string|max:10', ]) - ->after(fn ($model) => Event::dispatch(new MediaChange($model))); + ->after(fn ($model) => Event::dispatch(new MediaChange($model))); } } diff --git a/tests/TestCase.php b/tests/TestCase.php index 4fbae25..c641035 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -17,7 +17,7 @@ class TestCase extends BaseTestCase */ protected function defineDatabaseMigrations(): void { - $this->loadMigrationsFrom(__DIR__.'/migrations'); + $this->loadMigrationsFrom(__DIR__ . '/migrations'); } protected function getPackageProviders($app): array @@ -44,8 +44,8 @@ class TestCase extends BaseTestCase protected function getFile(string $location, string $as): File { - $path = __DIR__.'/stubs/'.$location; - $to = sys_get_temp_dir().'/'.$as; + $path = __DIR__ . '/stubs/' . $location; + $to = sys_get_temp_dir() . '/' . $as; copy($path, $to); return new File($to);