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 May 24, 2024
1 parent 3afe621 commit 8479335
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/Conversions/Manipulations.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
namespace Spatie\MediaLibrary\Conversions;

use Spatie\Image\Drivers\ImageDriver;
use Spatie\Image\Enums\BorderType;
use Spatie\Image\Enums\AlignPosition;
use Spatie\Image\Enums\BorderType;
use Spatie\Image\Enums\ColorFormat;
use Spatie\Image\Enums\Constraint;
use Spatie\Image\Enums\CropPosition;
use Spatie\Image\Enums\Fit;
use Spatie\Image\Enums\FlipDirection;


/** @mixin \Spatie\Image\Drivers\ImageDriver */
class Manipulations
{
Expand Down Expand Up @@ -60,7 +59,7 @@ public function isEmpty(): bool
public function apply(ImageDriver $image): void
{
foreach ($this->manipulations as $manipulationName => $parameters) {
match($manipulationName){
match ($manipulationName) {
'border' => (isset($parameters['type'])) && $parameters['type'] = BorderType::from($parameters['type']),
'watermark' => (isset($parameters['fit'])) && $parameters['fit'] = Fit::from($parameters['fit']),
'watermark','resizeCanvas','insert' => (isset($parameters['position'])) && $parameters['position'] = AlignPosition::from($parameters['position']),
Expand Down
8 changes: 4 additions & 4 deletions tests/Feature/FileAdder/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Storage;
use Spatie\Image\Enums\BorderType;
use Spatie\MediaLibrary\Conversions\ImageGenerators\ImageGeneratorFactory;
use Spatie\MediaLibrary\MediaCollections\Exceptions\DiskCannotBeAccessed;
use Spatie\MediaLibrary\MediaCollections\Exceptions\DiskDoesNotExist;
Expand All @@ -16,7 +17,6 @@
use Spatie\MediaLibrary\MediaCollections\Models\Media;
use Spatie\MediaLibrary\Tests\TestSupport\RenameOriginalFileNamer;
use Spatie\MediaLibrary\Tests\TestSupport\TestModels\TestModel;
use Spatie\Image\Enums\BorderType;
use Symfony\Component\HttpFoundation\File\UploadedFile;

it('can add an file to the default collection', function () {
Expand Down Expand Up @@ -457,9 +457,9 @@
->addMedia($this->getTestJpg())
->preservingOriginal()
->withManipulations(['thumb' => [
'background' => ['color'=>'ffffff'],
'border' =>['width'=>15, 'type'=>BorderType::Shrink, 'color'=>'000000']
]
'background' => ['color' => 'ffffff'],
'border' => ['width' => 15, 'type' => BorderType::Shrink, 'color' => '000000'],
],
])
->toMediaCollection();
})->throwsNoExceptions();
Expand Down

0 comments on commit 8479335

Please sign in to comment.