Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed Sep 22, 2023
1 parent f44b8f8 commit daa2922
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
8 changes: 6 additions & 2 deletions src/app/Http/Controllers/ImageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand All @@ -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;
}
}
4 changes: 2 additions & 2 deletions src/tests/Feature/Controller/ImageControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/tests/Feature/Controller/UserControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion src/tests/Unit/ImageControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

class ImageControllerTest extends TestCase
{

public static function setUpBeforeClass(): void
{
self::$controller = new ImageController();
Expand Down

0 comments on commit daa2922

Please sign in to comment.