Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
timvandijck authored and github-actions[bot] committed Nov 8, 2024
1 parent 9b24c13 commit cc46eb8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/Conversions/ConversionCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function getByName(string $name): Conversion
->getConversions($this->media->collection_name)
->first(fn (Conversion $conversion) => $conversion->getName() === $name);

if (!$conversion) {
if (! $conversion) {
throw InvalidConversion::unknownName($name);
}

Expand All @@ -53,7 +53,7 @@ protected function addConversionsFromRelatedModel(Media $media): void
{
$modelName = Arr::get(Relation::morphMap(), $media->model_type, $media->model_type);

if (!class_exists($modelName)) {
if (! class_exists($modelName)) {
return;
}

Expand Down Expand Up @@ -100,7 +100,7 @@ protected function addManipulationToConversion(Manipulations $manipulations, str
{
/** @var Conversion|null $conversion */
$conversion = $this->first(function (Conversion $conversion) use ($conversionName) {
if (!$conversion->shouldBePerformedOn($this->media->collection_name)) {
if (! $conversion->shouldBePerformedOn($this->media->collection_name)) {
return false;
}

Expand Down Expand Up @@ -128,5 +128,4 @@ public function getConversionsFiles(string $collectionName = ''): self
->getConversions($collectionName)
->map(fn (Conversion $conversion) => $conversion->getConversionFile($this->media));
}

}
4 changes: 2 additions & 2 deletions tests/Conversions/ConversionCollectionConversionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function registerMediaCollections(): void
->and($conversions->first()->getName())->toBe('preview')
->and($conversions->first()->getResultExtension())->toBe('png')
->and($conversions->first()->getManipulations()->toArray())->toMatchArray([
'fit' => [Fit::Crop, 50, 50],
'fit' => [Fit::Crop, 50, 50],
'format' => ['png'],
])
->and($conversions->last()->getName())->toBe('web')
Expand All @@ -80,7 +80,7 @@ public function registerMediaCollections(): void
->and($conversions->first()->getName())->toBe('preview')
->and($conversions->first()->getResultExtension())->toBe('jpeg')
->and($conversions->first()->getManipulations()->toArray())->toMatchArray([
'fit' => [Fit::Crop, 300, 100],
'fit' => [Fit::Crop, 300, 100],
'format' => ['jpeg'],
])
->and($conversions->last()->getName())->toBe('web')
Expand Down

0 comments on commit cc46eb8

Please sign in to comment.