Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGab committed Jun 16, 2024
1 parent 2e7bb0c commit e92686d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Traits/HasMedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -182,7 +182,7 @@ protected function getNestedMediaConversion(
array $conversionsNames,
): ?MediaConversion {

if (empty($conversionsNames) || !$mediaConversion) {
if (empty($conversionsNames) || ! $mediaConversion) {
return $mediaConversion;
}

Expand Down Expand Up @@ -227,7 +227,7 @@ public function deleteMedia(int $mediaId)
{
$media = $this->media->find($mediaId);

if (!$media) {
if (! $media) {
return null;
}

Expand Down Expand Up @@ -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}.");
}
Expand Down Expand Up @@ -303,7 +303,7 @@ public function dispatchConversion($media, string $conversionName): static
{
$conversion = $this->getMediaConversion($media, $conversionName);

if (!$conversion) {
if (! $conversion) {
return $this;
}

Expand Down Expand Up @@ -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);
});
}

Expand Down

0 comments on commit e92686d

Please sign in to comment.