diff --git a/src/Asset/MappedParameter/ImageDownloadConfigParameter.php b/src/Asset/MappedParameter/ImageDownloadConfigParameter.php index 2f82266a..7d9c7d9b 100644 --- a/src/Asset/MappedParameter/ImageDownloadConfigParameter.php +++ b/src/Asset/MappedParameter/ImageDownloadConfigParameter.php @@ -34,10 +34,10 @@ public function __construct( private ?int $quality = 85, private ?int $dpi = null, private ?string $positioning = 'center', - private string $cover = 'false', - private string $frame = 'false', - private string $contain = 'false', - private string $forceResize = 'false', + private bool $cover = false, + private bool $frame = false, + private bool $contain = false, + private bool $forceResize = false, ) { $this->validateResizeMode(); @@ -100,25 +100,22 @@ public function getPositioning(): ?string public function getForceResize(): bool { - return $this->forceResize === 'true'; // TODO: symfony 7.1 will support bool type + return $this->forceResize; } public function hasCover(): bool { - // TODO: symfony 7.1 will support bool type - return $this->cover === 'true'; + return $this->cover; } public function hasFrame(): bool { - // TODO: symfony 7.1 will support bool type - return $this->frame === 'true'; + return $this->frame; } public function hasContain(): bool { - // TODO: symfony 7.1 will support bool type - return $this->contain === 'true'; + return $this->contain; } private function isValidWidth(): bool diff --git a/src/Asset/MappedParameter/VideoImageStreamConfigParameter.php b/src/Asset/MappedParameter/VideoImageStreamConfigParameter.php index 15948a11..136b941f 100644 --- a/src/Asset/MappedParameter/VideoImageStreamConfigParameter.php +++ b/src/Asset/MappedParameter/VideoImageStreamConfigParameter.php @@ -26,16 +26,16 @@ public function __construct( private ?int $width = null, private ?int $height = null, - private ?string $aspectRatio = null, - private ?string $frame = null, - private ?string $async = null, + private bool $aspectRatio = false, + private bool $frame = false, + private bool $async = false, ) { - if ($this->frame === 'true' && ($this->width === null || $this->height === null)) { + if ($this->frame && ($this->width === null || $this->height === null)) { throw new InvalidThumbnailConfigurationException( 'Width and height must be set when using frame configuration' ); } - if ($this->aspectRatio === 'true' && $this->width === null) { + if ($this->aspectRatio && $this->width === null) { throw new InvalidThumbnailConfigurationException( 'Width must be set when using aspectRatio configuration' ); @@ -54,16 +54,16 @@ public function getHeight(): ?int public function getAspectRatio(): bool { - return $this->aspectRatio === 'true'; // TODO: symfony 7.1 will support bool type + return $this->aspectRatio; } public function getFrame(): bool { - return $this->frame === 'true'; // TODO: symfony 7.1 will support bool type + return $this->frame; } public function getAsync(): bool { - return $this->async === 'true'; // TODO: symfony 7.1 will support bool type + return $this->async; } } diff --git a/src/Asset/Service/BinaryService.php b/src/Asset/Service/BinaryService.php index a6502847..67ba81b3 100644 --- a/src/Asset/Service/BinaryService.php +++ b/src/Asset/Service/BinaryService.php @@ -147,9 +147,11 @@ public function streamVideoImageThumbnail( if ($imageConfig->getHeight()) { $imageParameters['height'] = $imageConfig->getHeight(); } + if ($imageConfig->getAspectRatio()) { $imageParameters['aspectratio'] = $imageConfig->getAspectRatio(); } + if ($imageConfig->getFrame()) { $imageParameters['frame'] = $imageConfig->getFrame(); } diff --git a/src/DataIndex/Request/DataObjectParameters.php b/src/DataIndex/Request/DataObjectParameters.php index e50c93a0..1d0d0227 100644 --- a/src/DataIndex/Request/DataObjectParameters.php +++ b/src/DataIndex/Request/DataObjectParameters.php @@ -26,10 +26,10 @@ public function __construct( int $pageSize = 10, ?int $parentId = null, ?string $idSearchTerm = null, - ?string $excludeFolders = null, + bool $excludeFolders = false, ?string $path = null, - ?string $pathIncludeParent = null, - ?string $pathIncludeDescendants = null, + bool $pathIncludeParent = false, + bool $pathIncludeDescendants = false, private ?string $className = null ) { parent::__construct( diff --git a/src/DataIndex/Request/ElementParameters.php b/src/DataIndex/Request/ElementParameters.php index 6a2518be..d457629e 100644 --- a/src/DataIndex/Request/ElementParameters.php +++ b/src/DataIndex/Request/ElementParameters.php @@ -39,10 +39,10 @@ public function __construct( int $pageSize = 10, private ?int $parentId = null, private ?string $idSearchTerm = null, - private ?string $excludeFolders = null, + private bool $excludeFolders = false, private ?string $path = null, - private ?string $pathIncludeParent = null, - private ?string $pathIncludeDescendants = null, + private bool $pathIncludeParent = false, + private bool $pathIncludeDescendants = false, private ?UserInterface $user = null ) { parent::__construct($page, $pageSize); @@ -60,7 +60,7 @@ public function getIdSearchTerm(): ?string public function getExcludeFolders(): bool { - return $this->excludeFolders === 'true'; // TODO: symfony 7.1 will support bool type + return $this->excludeFolders; } public function getPath(): ?string @@ -70,12 +70,12 @@ public function getPath(): ?string public function getPathIncludeParent(): bool { - return $this->pathIncludeParent === 'true'; // TODO: symfony 7.1 will support bool type + return $this->pathIncludeParent; } public function getPathIncludeDescendants(): bool { - return $this->pathIncludeDescendants === 'true'; // TODO: symfony 7.1 will support bool type + return $this->pathIncludeDescendants; } public function getUser(): ?UserInterface diff --git a/src/Document/MappedParameter/ExcludeMainSiteParameter.php b/src/Document/MappedParameter/ExcludeMainSiteParameter.php index f16bc75f..01cd56ab 100644 --- a/src/Document/MappedParameter/ExcludeMainSiteParameter.php +++ b/src/Document/MappedParameter/ExcludeMainSiteParameter.php @@ -22,12 +22,12 @@ final readonly class ExcludeMainSiteParameter { public function __construct( - private ?string $excludeMainSite = null + private bool $excludeMainSite = false ) { } public function getExcludeMainSite(): bool { - return $this->excludeMainSite === 'true'; // TODO: symfony 7.1 will support bool type + return $this->excludeMainSite; } }