Skip to content

Commit

Permalink
Merge pull request #3726 from spatie/revert-pr-3715
Browse files Browse the repository at this point in the history
Revert PR  #3715
  • Loading branch information
timvandijck authored Nov 15, 2024
2 parents 9acf3f1 + 7174f6e commit 2e6aa4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 106 deletions.
10 changes: 3 additions & 7 deletions src/Conversions/ConversionCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ public function setMedia(Media $media): self

public function getByName(string $name): Conversion
{
$conversion = $this
->getConversions($this->media->collection_name)
->first(fn (Conversion $conversion) => $conversion->getName() === $name);
$conversion = $this->first(fn (Conversion $conversion) => $conversion->getName() === $name);

if (! $conversion) {
throw InvalidConversion::unknownName($name);
Expand Down Expand Up @@ -91,9 +89,7 @@ public function getConversions(string $collectionName = ''): self
return $this;
}

return $this
->filter(fn (Conversion $conversion) => $conversion->shouldBePerformedOn($collectionName))
->values();
return $this->filter(fn (Conversion $conversion) => $conversion->shouldBePerformedOn($collectionName));
}

protected function addManipulationToConversion(Manipulations $manipulations, string $conversionName): void
Expand All @@ -117,7 +113,7 @@ protected function addManipulationToConversion(Manipulations $manipulations, str

if ($conversionName === '*') {
$this->each(
fn (Conversion $conversion) => $conversion->addAsFirstManipulations(clone $manipulations),
fn (Conversion $conversion) => $conversion->addAsFirstManipulations(clone $manipulations)
);
}
}
Expand Down
99 changes: 0 additions & 99 deletions tests/Conversions/ConversionCollectionConversionsTest.php

This file was deleted.

0 comments on commit 2e6aa4f

Please sign in to comment.