From 0d4b30fc5ee7fea552db32f25b5aa8fce556a084 Mon Sep 17 00:00:00 2001 From: freekmurze Date: Tue, 24 Oct 2023 06:50:33 +0000 Subject: [PATCH] Fix styling --- src/MediaCollections/Filesystem.php | 3 +-- src/Support/FileRemover/DefaultFileRemover.php | 5 +++-- src/Support/FileRemover/FileBaseFileRemover.php | 5 ++--- src/Support/FileRemover/FileRemoverFactory.php | 6 +++--- tests/Feature/Media/DeleteTest.php | 6 +++--- .../PathGenerator/CustomDirectoryStructurePathGenerator.php | 2 +- 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/MediaCollections/Filesystem.php b/src/MediaCollections/Filesystem.php index cbdb34393..58a63f54c 100644 --- a/src/MediaCollections/Filesystem.php +++ b/src/MediaCollections/Filesystem.php @@ -2,17 +2,16 @@ namespace Spatie\MediaLibrary\MediaCollections; -use Exception; use Illuminate\Contracts\Filesystem\Factory; use Illuminate\Support\Facades\Storage; use Illuminate\Support\Str; use Spatie\MediaLibrary\Conversions\ConversionCollection; use Spatie\MediaLibrary\Conversions\FileManipulator; -use Spatie\MediaLibrary\Support\FileRemover\FileRemoverFactory; use Spatie\MediaLibrary\MediaCollections\Events\MediaHasBeenAdded; use Spatie\MediaLibrary\MediaCollections\Exceptions\DiskCannotBeAccessed; use Spatie\MediaLibrary\MediaCollections\Models\Media; use Spatie\MediaLibrary\Support\File; +use Spatie\MediaLibrary\Support\FileRemover\FileRemoverFactory; use Spatie\MediaLibrary\Support\PathGenerator\PathGeneratorFactory; use Spatie\MediaLibrary\Support\RemoteFile; diff --git a/src/Support/FileRemover/DefaultFileRemover.php b/src/Support/FileRemover/DefaultFileRemover.php index 0c543a2e2..84288d104 100644 --- a/src/Support/FileRemover/DefaultFileRemover.php +++ b/src/Support/FileRemover/DefaultFileRemover.php @@ -3,15 +3,16 @@ namespace Spatie\MediaLibrary\Support\FileRemover; use Exception; -use Illuminate\Support\Str; use Illuminate\Contracts\Filesystem\Factory; +use Illuminate\Support\Str; use Spatie\MediaLibrary\MediaCollections\Filesystem; use Spatie\MediaLibrary\MediaCollections\Models\Media; class DefaultFileRemover implements FileRemover { public function __construct(protected Filesystem $mediaFileSystem, protected Factory $filesystem) - {} + { + } public function removeAllFiles(Media $media): void { diff --git a/src/Support/FileRemover/FileBaseFileRemover.php b/src/Support/FileRemover/FileBaseFileRemover.php index 99593f97e..9119ab682 100644 --- a/src/Support/FileRemover/FileBaseFileRemover.php +++ b/src/Support/FileRemover/FileBaseFileRemover.php @@ -5,13 +5,12 @@ use Illuminate\Contracts\Filesystem\Factory; use Spatie\MediaLibrary\MediaCollections\Filesystem; use Spatie\MediaLibrary\MediaCollections\Models\Media; -use Spatie\MediaLibrary\Support\FileRemover\FileRemover; -use Spatie\MediaLibrary\Support\FileRemover\DefaultFileRemover; class FileBaseFileRemover extends DefaultFileRemover implements FileRemover { public function __construct(protected Filesystem $mediaFileSystem, protected Factory $filesystem) - {} + { + } public function removeAllFiles(Media $media): void { diff --git a/src/Support/FileRemover/FileRemoverFactory.php b/src/Support/FileRemover/FileRemoverFactory.php index f8a70e4e1..336804f05 100644 --- a/src/Support/FileRemover/FileRemoverFactory.php +++ b/src/Support/FileRemover/FileRemoverFactory.php @@ -2,8 +2,8 @@ namespace Spatie\MediaLibrary\Support\FileRemover; -use Spatie\MediaLibrary\MediaCollections\Models\Media; use Spatie\MediaLibrary\MediaCollections\Exceptions\InvalidFileRemover; +use Spatie\MediaLibrary\MediaCollections\Models\Media; class FileRemoverFactory { @@ -18,11 +18,11 @@ public static function create(Media $media): FileRemover protected static function guardAgainstInvalidFileRemover(string $fileRemoverClass): void { - if (!class_exists($fileRemoverClass)) { + if (! class_exists($fileRemoverClass)) { throw InvalidFileRemover::doesntExist($fileRemoverClass); } - if (!is_subclass_of($fileRemoverClass, FileRemover::class)) { + if (! is_subclass_of($fileRemoverClass, FileRemover::class)) { throw InvalidFileRemover::doesNotImplementFileRemover($fileRemoverClass); } } diff --git a/tests/Feature/Media/DeleteTest.php b/tests/Feature/Media/DeleteTest.php index 4c8dc0ff2..746552ea9 100644 --- a/tests/Feature/Media/DeleteTest.php +++ b/tests/Feature/Media/DeleteTest.php @@ -1,13 +1,13 @@ testModel->addMedia($this->getTestJpg())->toMediaCollection('images'); diff --git a/tests/Support/PathGenerator/CustomDirectoryStructurePathGenerator.php b/tests/Support/PathGenerator/CustomDirectoryStructurePathGenerator.php index 7bfe27c4c..ad10b3d29 100644 --- a/tests/Support/PathGenerator/CustomDirectoryStructurePathGenerator.php +++ b/tests/Support/PathGenerator/CustomDirectoryStructurePathGenerator.php @@ -21,4 +21,4 @@ public function getPathForResponsiveImages(Media $media): string { return $this->getPath($media) . 'cri/'; } -} \ No newline at end of file +}