Skip to content

Commit

Permalink
Apply php-cs-fixer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mcop1 authored and github-actions[bot] committed Dec 3, 2024
1 parent 972bd25 commit b4c275d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/Asset/Controller/Image/CustomStreamController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
use Pimcore\Bundle\StudioBackendBundle\Util\Constant\HttpResponseCodes;
use Pimcore\Bundle\StudioBackendBundle\Util\Constant\HttpResponseHeaders;
use Pimcore\Bundle\StudioBackendBundle\Util\Constant\UserPermissions;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\HttpKernel\Attribute\MapQueryString;
use Symfony\Component\Routing\Attribute\Route;
Expand Down
13 changes: 6 additions & 7 deletions src/Asset/MappedParameter/ImageDownloadConfigParameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,22 @@ public function __construct(
throw new InvalidArgumentException('Invalid resize mode ' . $this->resizeMode);
}

if($this->resizeMode === ResizeModes::SCALE_BY_HEIGHT && !$this->isValidHeight()) {
if ($this->resizeMode === ResizeModes::SCALE_BY_HEIGHT && !$this->isValidHeight()) {
throw new InvalidArgumentException(
'Height must be set and non-negative when using scale by width resize mode'
);
}

if($this->resizeMode === ResizeModes::SCALE_BY_WIDTH && !$this->isValidWidth()) {
if ($this->resizeMode === ResizeModes::SCALE_BY_WIDTH && !$this->isValidWidth()) {
throw new InvalidArgumentException(
'Width must be set and non-negative when using scale by width resize mode'
);
}

if(
if (
(!$this->isValidWidth() || !$this->isValidHeight()) &&
($this->hasFrame() || $this->hasCover() || $this->hasContain() || $this->resizeMode === ResizeModes::RESIZE)
)
{
) {
throw new InvalidArgumentException(
'Width, height must be set and non-negative when using frame, cover, contain or resize'
);
Expand Down Expand Up @@ -115,7 +114,7 @@ public function getFrameTransformation(): array
return [
'width' => $this->getWidth(),
'height' => $this->getHeight(),
'forceResize' => $this->getForceResize()
'forceResize' => $this->getForceResize(),
];
}

Expand All @@ -124,7 +123,7 @@ public function getContainTransformation(): array
return [
'width' => $this->getWidth(),
'height' => $this->getHeight(),
'forceResize' => $this->getForceResize()
'forceResize' => $this->getForceResize(),
];
}

Expand Down
3 changes: 1 addition & 2 deletions src/Asset/Service/BinaryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ public function streamPreviewImageThumbnail(Asset $image): StreamedResponse
public function streamImageThumbnailFromConfig(
Asset $image,
ImageDownloadConfigParameter $configParameter
): StreamedResponse
{
): StreamedResponse {
if (!$image instanceof Image) {
throw new InvalidElementTypeException($image->getType());
}
Expand Down
6 changes: 3 additions & 3 deletions src/Asset/Service/ThumbnailService.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,15 @@ private function getImageThumbnailConfig(
}
}

if($parameters->hasCover()) {
if ($parameters->hasCover()) {
$thumbnailConfig->addItem('cover', $parameters->getCoverTransformation());
}

if($parameters->hasFrame()) {
if ($parameters->hasFrame()) {
$thumbnailConfig->addItem('frame', $parameters->getFrameTransformation());
}

if($parameters->hasContain()) {
if ($parameters->hasContain()) {
$thumbnailConfig->addItem('contain', $parameters->getContainTransformation());
}

Expand Down

0 comments on commit b4c275d

Please sign in to comment.