From e92686d277ae12d11f8708b57ff1802809e1f4d5 Mon Sep 17 00:00:00 2001 From: Quentin Gabriele Date: Mon, 17 Jun 2024 00:58:07 +0200 Subject: [PATCH] format --- src/Traits/HasMedia.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Traits/HasMedia.php b/src/Traits/HasMedia.php index 397f29d..847dbbe 100644 --- a/src/Traits/HasMedia.php +++ b/src/Traits/HasMedia.php @@ -26,14 +26,14 @@ public static function bootHasMedia() { static::deleting(function (Model $model) { - if (!config('media.delete_media_with_model')) { + if (! config('media.delete_media_with_model')) { return true; } - $isSoftDeleting = method_exists($model, 'isForceDeleting') && !$model->isForceDeleting(); + $isSoftDeleting = method_exists($model, 'isForceDeleting') && ! $model->isForceDeleting(); if ( - $isSoftDeleting && !config('media.delete_media_with_trashed_model') + $isSoftDeleting && ! config('media.delete_media_with_trashed_model') ) { return true; } @@ -182,7 +182,7 @@ protected function getNestedMediaConversion( array $conversionsNames, ): ?MediaConversion { - if (empty($conversionsNames) || !$mediaConversion) { + if (empty($conversionsNames) || ! $mediaConversion) { return $mediaConversion; } @@ -227,7 +227,7 @@ public function deleteMedia(int $mediaId) { $media = $this->media->find($mediaId); - if (!$media) { + if (! $media) { return null; } @@ -258,7 +258,7 @@ public function addMedia( $collection = $this->getMediaCollection($collection_name); - if (!$collection) { + if (! $collection) { $class = static::class; throw new Exception("[Media collection not registered] {$collection_name} is not registered for the model {$class}."); } @@ -303,7 +303,7 @@ public function dispatchConversion($media, string $conversionName): static { $conversion = $this->getMediaConversion($media, $conversionName); - if (!$conversion) { + if (! $conversion) { return $this; } @@ -354,9 +354,9 @@ public function dispatchConversions( ->only($only) ->except($except); - if (!$force) { + if (! $force) { $conversions = $conversions->filter(function (MediaConversion $conversion) use ($media) { - return !$media->hasGeneratedConversion($conversion->conversionName); + return ! $media->hasGeneratedConversion($conversion->conversionName); }); }