From daa29228d61c2fe4de0d90adfd3a38842eb67adc Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Fri, 22 Sep 2023 16:58:59 -0600 Subject: [PATCH] fix: lint --- src/app/Http/Controllers/ImageController.php | 8 ++++++-- src/tests/Feature/Controller/ImageControllerTest.php | 4 ++-- src/tests/Feature/Controller/UserControllerTest.php | 2 +- src/tests/Unit/ImageControllerTest.php | 1 - 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/app/Http/Controllers/ImageController.php b/src/app/Http/Controllers/ImageController.php index 886ad56..fc7e0a3 100644 --- a/src/app/Http/Controllers/ImageController.php +++ b/src/app/Http/Controllers/ImageController.php @@ -110,7 +110,9 @@ public static function sanatizeImageFilename($file): string */ public static function getImageAssetPath(?string $subdirectory, ?string $imageName): string|null { - return isset($subdirectory) && isset($imageName) ? asset('storage/' . self::$imagesDir . "/$subdirectory/$imageName") : null; + return isset($subdirectory) && isset($imageName) + ? asset('storage/' . self::$imagesDir . "/$subdirectory/$imageName") + : null; } /** @@ -122,6 +124,8 @@ public static function getImageAssetPath(?string $subdirectory, ?string $imageNa */ public static function getImagePublicPath(?string $subdirectory, ?string $imageName): string|null { - return isset($subdirectory) && isset($imageName) ? public_path('storage/' . self::$imagesDir . "/$subdirectory/$imageName") : null; + return isset($subdirectory) && isset($imageName) + ? public_path('storage/' . self::$imagesDir . "/$subdirectory/$imageName") + : null; } } diff --git a/src/tests/Feature/Controller/ImageControllerTest.php b/src/tests/Feature/Controller/ImageControllerTest.php index 33d3e2b..e42dcd0 100644 --- a/src/tests/Feature/Controller/ImageControllerTest.php +++ b/src/tests/Feature/Controller/ImageControllerTest.php @@ -42,7 +42,7 @@ public function testUploadPostImage() { Storage::fake('public'); - $request = Request::create("/images", 'POST', [], [], [ + $request = Request::create('/images', 'POST', [], [], [ 'image' => UploadedFile::fake()->image('image.jpg'), ]); $response = self::$controller->uploadPostImage($request); @@ -60,7 +60,7 @@ public function testDeletePostImage() { Storage::fake('public'); - $request = Request::create("/images", 'POST', [], [], [ + $request = Request::create('/images', 'POST', [], [], [ 'image' => UploadedFile::fake()->image('image.jpg'), ]); $response = self::$controller->uploadPostImage($request); diff --git a/src/tests/Feature/Controller/UserControllerTest.php b/src/tests/Feature/Controller/UserControllerTest.php index 241c72e..76c370d 100644 --- a/src/tests/Feature/Controller/UserControllerTest.php +++ b/src/tests/Feature/Controller/UserControllerTest.php @@ -94,7 +94,7 @@ public function testUpdateProfilePic() $authedUser = User::find(1); $this->actingAs($authedUser); - $request = Request::create("/update-profile-pic", 'POST', [], [], [ + $request = Request::create('/update-profile-pic', 'POST', [], [], [ 'image' => UploadedFile::fake()->image('image.jpg'), ]); $response = self::$controller->updateProfilePic($request); diff --git a/src/tests/Unit/ImageControllerTest.php b/src/tests/Unit/ImageControllerTest.php index 77fc48e..b6fbb7b 100644 --- a/src/tests/Unit/ImageControllerTest.php +++ b/src/tests/Unit/ImageControllerTest.php @@ -7,7 +7,6 @@ class ImageControllerTest extends TestCase { - public static function setUpBeforeClass(): void { self::$controller = new ImageController();