diff --git a/Classes/Domain/Factory/BackendLayoutFactory.php b/Classes/Domain/Factory/BackendLayoutFactory.php new file mode 100644 index 0000000..52bdbbb --- /dev/null +++ b/Classes/Domain/Factory/BackendLayoutFactory.php @@ -0,0 +1,54 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use Codappix\ResponsiveImages\Configuration\ConfigurationManager; +use Codappix\ResponsiveImages\Domain\Model\BackendLayout; +use Codappix\ResponsiveImages\Domain\Model\RootlineElementInterface; + +class BackendLayoutFactory +{ + public function __construct( + private ConfigurationManager $configurationManager, + private readonly ScalingFactory $scalingFactory + ) { + } + + public function create(string $configurationPath): RootlineElementInterface + { + $scaling = $this->scalingFactory->getByConfigurationPath($configurationPath); + + $columns = $this->determineColumns($configurationPath . '.columns'); + + return new BackendLayout($scaling, $columns); + } + + + private function determineColumns(string $configurationPath): array + { + $columns = $this->configurationManager->getByPath($configurationPath); + assert(is_array($columns)); + return array_map(static fn ($column): int => (int) $column, array_keys($columns)); + } +} diff --git a/Classes/Sizes/Container.php b/Classes/Domain/Factory/ContainerFactory.php similarity index 59% rename from Classes/Sizes/Container.php rename to Classes/Domain/Factory/ContainerFactory.php index 738914e..49fe7b2 100644 --- a/Classes/Sizes/Container.php +++ b/Classes/Domain/Factory/ContainerFactory.php @@ -2,9 +2,10 @@ declare(strict_types=1); -namespace Codappix\ResponsiveImages\Sizes; +namespace Codappix\ResponsiveImages\Domain\Factory; /* + * Copyright (C) 2024 Justus Moroni * Copyright (C) 2024 Daniel Gohlke * * This program is free software; you can redistribute it and/or @@ -23,17 +24,30 @@ * 02110-1301, USA. */ -final class Container extends AbstractContentElement +use Codappix\ResponsiveImages\Configuration\ConfigurationManager; +use Codappix\ResponsiveImages\Domain\Model\Container; + +class ContainerFactory { - public function __construct(array $data) + public function __construct( + private readonly ConfigurationManager $configurationManager + ) { + } + + public function createFromData(array $data): Container { - parent::__construct($data); + $this->contentType = $data['CType']; + $this->colPos = $data['colPos']; - $this->scalingConfiguration = $this->readConfigurationByPath( + $scalingConfiguration = $this->readConfigurationByPath( implode('.', [ 'container', $this->contentType, ]) ); + + return new Container( + $scalingConfiguration + ); } } diff --git a/Classes/Sizes/ContainerColumn.php b/Classes/Domain/Factory/RootlineElementFactory.php similarity index 63% rename from Classes/Sizes/ContainerColumn.php rename to Classes/Domain/Factory/RootlineElementFactory.php index 55310be..12e0be1 100644 --- a/Classes/Sizes/ContainerColumn.php +++ b/Classes/Domain/Factory/RootlineElementFactory.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Codappix\ResponsiveImages\Sizes; +namespace Codappix\ResponsiveImages\Domain\Factory; /* * Copyright (C) 2024 Daniel Gohlke @@ -23,21 +23,20 @@ * 02110-1301, USA. */ -class ContainerColumn extends AbstractContentElement +use Codappix\ResponsiveImages\Domain\Model\RootlineElement; +use Codappix\ResponsiveImages\Domain\Model\RootlineElementInterface; + +class RootlineElementFactory { public function __construct( - array $data, - int $colPos + private readonly ScalingFactory $scalingFactory ) { - parent::__construct($data); + } + + public function create(array $data, string $configurationPath): RootlineElementInterface + { + $scaling = $this->scalingFactory->getByConfigurationPath($configurationPath); - $this->scalingConfiguration = $this->readConfigurationByPath( - implode('.', [ - 'container', - $this->contentType, - 'columns', - (string) $colPos, - ]) - ); + return new RootlineElement($scaling, $data); } } diff --git a/Classes/Domain/Factory/RootlineFactory.php b/Classes/Domain/Factory/RootlineFactory.php index d093368..6fe707c 100644 --- a/Classes/Domain/Factory/RootlineFactory.php +++ b/Classes/Domain/Factory/RootlineFactory.php @@ -25,20 +25,15 @@ */ use B13\Container\Tca\Registry; +use Codappix\ResponsiveImages\Domain\Model\RootlineElementInterface; use Codappix\ResponsiveImages\Domain\Repository\ContainerRepository; -use Codappix\ResponsiveImages\Sizes\BackendLayout; -use Codappix\ResponsiveImages\Sizes\BackendLayoutColumn; -use Codappix\ResponsiveImages\Sizes\Container; -use Codappix\ResponsiveImages\Sizes\ContainerColumn; -use Codappix\ResponsiveImages\Sizes\ContentElement; -use Codappix\ResponsiveImages\Sizes\ContentElementInterface; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Frontend\Page\PageLayoutResolver; final class RootlineFactory { - private BackendLayout $backendLayout; + private RootlineElementInterface $backendLayout; private string $fieldName; @@ -46,7 +41,9 @@ final class RootlineFactory public function __construct( private readonly ContainerRepository $containerRepository, - private readonly PageLayoutResolver $pageLayoutResolver + private readonly PageLayoutResolver $pageLayoutResolver, + private readonly BackendLayoutFactory $backendLayoutFactory, + private readonly RootlineElementFactory $rootlineElementFactory ) { } @@ -72,35 +69,35 @@ public function getFinalSizes( private function determineBackendLayout(): void { - $typoscriptFrontendController = $GLOBALS['TSFE']; + $tsfe = $GLOBALS['TSFE']; $this->backendLayoutIdentifier = $this->pageLayoutResolver->getLayoutForPage( - $typoscriptFrontendController->page, - $typoscriptFrontendController->rootLine + $tsfe->page, + $tsfe->rootLine ); - $this->backendLayout = new BackendLayout($this->backendLayoutIdentifier); + $this->backendLayout = $this->backendLayoutFactory->create( + $this->getConfigPathForBackendLayout() + ); } private function determineContentElement( - ?ContentElementInterface $contentElement, + ?RootlineElementInterface $contentElement, array $data - ): ContentElementInterface { + ): RootlineElementInterface { if ( class_exists(Registry::class) && GeneralUtility::makeInstance(Registry::class)->isContainerElement($data['CType']) && !is_null($contentElement) ) { - $newContainerColumn = new ContainerColumn($data, $contentElement->getColPos()); - $contentElement->setParent($newContainerColumn); - - $newContainer = new Container($data); - $newContainerColumn->setParent($newContainer); - - return $newContainer; + return $this->determineContainer($data, $contentElement); } - $newContentElement = new ContentElement($data, $this->fieldName); + $newContentElement = $this->rootlineElementFactory->create( + $data, + $this->getConfigPathForContentElement($data['CType']) + ); + if (!is_null($contentElement)) { $contentElement->setParent($newContentElement); } @@ -108,10 +105,31 @@ class_exists(Registry::class) return $newContentElement; } - private function determineRootline(ContentElementInterface $contentElement): void + private function determineContainer(array $data, RootlineElementInterface $contentElement): RootlineElementInterface + { + $newContainerColumn = $this->rootlineElementFactory->create( + $data, + $this->getConfigPathForContainerColumn($data['CType'], $contentElement) + ); + $contentElement->setParent($newContainerColumn); + + $newContainer = $this->rootlineElementFactory->create( + $data, + $this->getConfigPathForContainer($data['CType']) + ); + $newContainerColumn->setParent($newContainer); + + return $newContainer; + } + + private function determineRootline(RootlineElementInterface $contentElement): void { if (in_array($contentElement->getColPos(), $this->backendLayout->getColumns(), true)) { - $newBackendLayoutColumn = new BackendLayoutColumn($this->backendLayoutIdentifier, $contentElement->getColPos()); + $newBackendLayoutColumn = $this->rootlineElementFactory->create( + [], + $this->getConfigPathForBackendLayoutColumn($contentElement) + ); + $newBackendLayoutColumn->setParent($this->backendLayout); $contentElement->setParent($newBackendLayoutColumn); @@ -130,4 +148,49 @@ private function determineRootline(ContentElementInterface $contentElement): voi $this->determineRootline($parent); } } + + private function getConfigPathForContentElement(string $CType): string + { + return implode('.', [ + 'contentelements', + $CType, + $this->fieldName, + ]); + } + + private function getConfigPathForContainer(string $CType): string + { + return implode('.', [ + 'container', + $CType, + ]); + } + + private function getConfigPathForContainerColumn(string $CType, RootlineElementInterface $contentElement): string + { + return implode('.', [ + 'container', + $CType, + 'columns', + (string) $contentElement->getColPos(), + ]); + } + + private function getConfigPathForBackendLayout(): string + { + return implode('.', [ + 'backendlayouts', + $this->backendLayoutIdentifier, + ]); + } + + private function getConfigPathForBackendLayoutColumn(RootlineElementInterface $contentElement): string + { + return implode('.', [ + 'backendlayouts', + $this->backendLayoutIdentifier, + 'columns', + $contentElement->getColPos(), + ]); + } } diff --git a/Classes/Sizes/BackendLayoutColumn.php b/Classes/Domain/Factory/ScalingFactory.php similarity index 54% rename from Classes/Sizes/BackendLayoutColumn.php rename to Classes/Domain/Factory/ScalingFactory.php index 2b515fe..cf0d638 100644 --- a/Classes/Sizes/BackendLayoutColumn.php +++ b/Classes/Domain/Factory/ScalingFactory.php @@ -2,10 +2,11 @@ declare(strict_types=1); -namespace Codappix\ResponsiveImages\Sizes; +namespace Codappix\ResponsiveImages\Domain\Factory; /* - * Copyright (C) 2020 Justus Moroni + * Copyright (C) 2024 Justus Moroni + * Copyright (C) 2024 Daniel Gohlke * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -23,26 +24,23 @@ * 02110-1301, USA. */ -final class BackendLayoutColumn extends AbstractRootlineElement implements RootlineElementInterface +use Codappix\ResponsiveImages\Configuration\ConfigurationManager; +use Codappix\ResponsiveImages\Domain\Model\Scaling; + +final class ScalingFactory { public function __construct( - protected string $identifier, - protected int $column + private ConfigurationManager $configurationManager ) { - parent::__construct(); - - $this->scalingConfiguration = $this->readConfigurationByPath( - implode('.', [ - 'backendlayouts', - $this->identifier, - 'columns', - (string) $this->column, - ]) - ); } - public function getColumn(): int + public function getByConfigurationPath(string $configurationPath): Scaling { - return $this->column; + $configuration = $this->configurationManager->getByPath($configurationPath); + + $multiplier = $configuration['multiplier'] ?? []; + $sizes = $configuration['sizes'] ?? []; + + return new Scaling($multiplier, $sizes); } } diff --git a/Classes/Domain/Model/BackendLayout.php b/Classes/Domain/Model/BackendLayout.php new file mode 100644 index 0000000..15d17c5 --- /dev/null +++ b/Classes/Domain/Model/BackendLayout.php @@ -0,0 +1,95 @@ + + * Copyright (C) 2024 Daniel Gohlke + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +class BackendLayout implements RootlineElementInterface +{ + private ?RootlineElementInterface $parent = null; + + public function __construct( + private readonly Scaling $scaling, + private readonly array $columns + ) { + } + + public function getParent(): ?RootlineElementInterface + { + return null; + } + + public function setParent(RootlineElementInterface $rootlineElement): void + { + $this->parent = null; + } + + public function getScaling(): Scaling + { + return $this->scaling; + } + + public function getFinalSize(array $multiplier): array + { + if ($this->getScaling()->getSizes()) { + if (empty($multiplier)) { + return $this->getScaling()->getSizes(); + } + + return $this->multiplyArray($this->getScaling()->getSizes(), $multiplier); + } + + if (is_null($this->getParent())) { + return $this->multiplyArray($this->getScaling()->getMultiplier(), $multiplier); + } + + return $this->getParent()->getFinalSize( + $this->multiplyArray($this->getScaling()->getMultiplier(), $multiplier) + ); + } + + public function getColumns(): array + { + return $this->columns; + } + + protected function multiplyArray(array $factor1, array $factor2): array + { + if (empty($factor1)) { + return $factor2; + } + if (empty($factor2)) { + return $factor1; + } + + foreach ($factor1 as $sizeName => &$size) { + if (isset($factor2[$sizeName]) === false) { + continue; + } + + $factor1[$sizeName] *= $factor2[$sizeName]; + } + + return $factor1; + } +} diff --git a/Classes/Sizes/ContentElementInterface.php b/Classes/Domain/Model/Container.php similarity index 76% rename from Classes/Sizes/ContentElementInterface.php rename to Classes/Domain/Model/Container.php index 1e2a8f5..2f5ce5e 100644 --- a/Classes/Sizes/ContentElementInterface.php +++ b/Classes/Domain/Model/Container.php @@ -2,9 +2,10 @@ declare(strict_types=1); -namespace Codappix\ResponsiveImages\Sizes; +namespace Codappix\ResponsiveImages\Domain\Model; /* + * Copyright (C) 2024 Justus Moroni * Copyright (C) 2024 Daniel Gohlke * * This program is free software; you can redistribute it and/or @@ -23,11 +24,10 @@ * 02110-1301, USA. */ -interface ContentElementInterface extends RootlineElementInterface +class Container { - public function getData(?string $dataIdentifier = null): mixed; - - public function getContentType(): string; - - public function getColPos(): int; + public function __construct( + private readonly Scaling $scalingConfiguration + ) { + } } diff --git a/Classes/Sizes/AbstractRootlineElement.php b/Classes/Domain/Model/RootlineElement.php similarity index 57% rename from Classes/Sizes/AbstractRootlineElement.php rename to Classes/Domain/Model/RootlineElement.php index 415f725..6b29c79 100644 --- a/Classes/Sizes/AbstractRootlineElement.php +++ b/Classes/Domain/Model/RootlineElement.php @@ -2,9 +2,10 @@ declare(strict_types=1); -namespace Codappix\ResponsiveImages\Sizes; +namespace Codappix\ResponsiveImages\Domain\Model; /* + * Copyright (C) 2024 Justus Moroni * Copyright (C) 2024 Daniel Gohlke * * This program is free software; you can redistribute it and/or @@ -23,20 +24,19 @@ * 02110-1301, USA. */ -use Codappix\ResponsiveImages\Configuration\ConfigurationManager; -use TYPO3\CMS\Core\Utility\GeneralUtility; - -abstract class AbstractRootlineElement +class RootlineElement implements RootlineElementInterface { - protected ConfigurationManager $configurationManager; - - protected ?RootlineElementInterface $parent = null; + protected int $colPos; - protected ScalingConfiguration $scalingConfiguration; + private ?RootlineElementInterface $parent = null; - public function __construct() - { - $this->configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class); + public function __construct( + private readonly Scaling $scaling, + private readonly array $data + ) { + if (isset($data['colPos'])) { + $this->colPos = $data['colPos']; + } } public function getParent(): ?RootlineElementInterface @@ -49,30 +49,48 @@ public function setParent(RootlineElementInterface $rootlineElement): void $this->parent = $rootlineElement; } - public function getScalingConfiguration(): ScalingConfiguration + public function getScaling(): Scaling { - return $this->scalingConfiguration; + return $this->scaling; } public function getFinalSize(array $multiplier): array { - if ($this->getScalingConfiguration()->getSizes()) { + if ($this->getScaling()->getSizes()) { if (empty($multiplier)) { - return $this->getScalingConfiguration()->getSizes(); + return $this->getScaling()->getSizes(); } - return $this->multiplyArray($this->getScalingConfiguration()->getSizes(), $multiplier); + return $this->multiplyArray($this->getScaling()->getSizes(), $multiplier); } if (is_null($this->getParent())) { - return $this->multiplyArray($this->getScalingConfiguration()->getMultiplier(), $multiplier); + return $this->multiplyArray($this->getScaling()->getMultiplier(), $multiplier); } return $this->getParent()->getFinalSize( - $this->multiplyArray($this->getScalingConfiguration()->getMultiplier(), $multiplier) + $this->multiplyArray($this->getScaling()->getMultiplier(), $multiplier) ); } + public function getData(?string $dataIdentifier = null): mixed + { + if ($dataIdentifier === null) { + return $this->data; + } + + if (isset($this->data[$dataIdentifier]) === false) { + throw new Exception('No data found for key ' . $dataIdentifier . ' in $this->data.'); + } + + return $this->data[$dataIdentifier]; + } + + public function getColPos(): int + { + return $this->colPos; + } + protected function multiplyArray(array $factor1, array $factor2): array { if (empty($factor1)) { @@ -92,14 +110,4 @@ protected function multiplyArray(array $factor1, array $factor2): array return $factor1; } - - protected function readConfigurationByPath(string $configurationPath): ScalingConfiguration - { - $configuration = $this->configurationManager->getByPath($configurationPath); - if (!is_array($configuration)) { - $configuration = []; - } - - return new ScalingConfiguration($configuration); - } } diff --git a/Classes/Sizes/RootlineElementInterface.php b/Classes/Domain/Model/RootlineElementInterface.php similarity index 86% rename from Classes/Sizes/RootlineElementInterface.php rename to Classes/Domain/Model/RootlineElementInterface.php index 5cdbd0c..22aa8c5 100644 --- a/Classes/Sizes/RootlineElementInterface.php +++ b/Classes/Domain/Model/RootlineElementInterface.php @@ -2,9 +2,10 @@ declare(strict_types=1); -namespace Codappix\ResponsiveImages\Sizes; +namespace Codappix\ResponsiveImages\Domain\Model; /* + * Copyright (C) 2024 Justus Moroni * Copyright (C) 2024 Daniel Gohlke * * This program is free software; you can redistribute it and/or @@ -29,7 +30,7 @@ public function getParent(): ?self; public function setParent(self $rootlineElement): void; - public function getFinalSize(array $multiplier): array; + public function getScaling(): Scaling; - public function getScalingConfiguration(): ScalingConfiguration; + public function getFinalSize(array $multiplier): array; } diff --git a/Classes/Sizes/ScalingConfiguration.php b/Classes/Domain/Model/Scaling.php similarity index 81% rename from Classes/Sizes/ScalingConfiguration.php rename to Classes/Domain/Model/Scaling.php index b101989..27b9feb 100644 --- a/Classes/Sizes/ScalingConfiguration.php +++ b/Classes/Domain/Model/Scaling.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Codappix\ResponsiveImages\Sizes; +namespace Codappix\ResponsiveImages\Domain\Model; /* * Copyright (C) 2024 Daniel Gohlke @@ -23,7 +23,7 @@ * 02110-1301, USA. */ -class ScalingConfiguration +class Scaling { /** * @var float[] @@ -35,14 +35,14 @@ class ScalingConfiguration */ private array $sizes = []; - public function __construct(array $configuration) + public function __construct(array $multiplier, array $sizes) { - if (isset($configuration['multiplier'])) { - $this->multiplier = array_map(static fn ($multiplier): float => (float) $multiplier, $configuration['multiplier']); + if (!empty($multiplier)) { + $this->multiplier = array_map(static fn ($multiplier): float => (float) $multiplier, $multiplier); } - if (isset($configuration['sizes'])) { - $this->sizes = array_map(static fn ($size): int => (int) $size, $configuration['sizes']); + if (!empty($sizes)) { + $this->sizes = array_map(static fn ($size): int => (int) $size, $sizes); } } diff --git a/Classes/Sizes/AbstractContentElement.php b/Classes/Sizes/AbstractContentElement.php deleted file mode 100644 index 7f5ec84..0000000 --- a/Classes/Sizes/AbstractContentElement.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. - */ - -use Exception; - -abstract class AbstractContentElement extends AbstractRootlineElement implements ContentElementInterface -{ - protected int $colPos; - - protected string $contentType; - - public function __construct( - protected array $data - ) { - parent::__construct(); - - $this->contentType = $data['CType']; - $this->colPos = $data['colPos']; - } - - public function getData(?string $dataIdentifier = null): mixed - { - if ($dataIdentifier === null) { - return $this->data; - } - - if (isset($this->data[$dataIdentifier]) === false) { - throw new Exception('No data found for key ' . $dataIdentifier . ' in $this->data.'); - } - - return $this->data[$dataIdentifier]; - } - - public function getColPos(): int - { - return $this->colPos; - } - - public function getContentType(): string - { - return $this->contentType; - } -} diff --git a/Classes/Sizes/BackendLayout.php b/Classes/Sizes/BackendLayout.php deleted file mode 100644 index 27bbfc1..0000000 --- a/Classes/Sizes/BackendLayout.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. - */ - -final class BackendLayout extends AbstractRootlineElement implements RootlineElementInterface -{ - /** - * @var int[] - */ - private array $columns; - - public function __construct( - protected string $identifier - ) { - parent::__construct(); - - $this->scalingConfiguration = $this->readConfigurationByPath( - implode('.', [ - 'backendlayouts', - $this->identifier, - ]) - ); - - $this->determineColumns(); - } - - public function getParent(): ?RootlineElementInterface - { - return null; - } - - public function setParent(RootlineElementInterface $rootlineElement): void - { - - } - - public function getFinalSize(array $multiplier): array - { - return $this->multiplyArray($this->scalingConfiguration->getSizes(), $multiplier); - } - - public function getColumns(): array - { - return $this->columns; - } - - private function determineColumns(): void - { - $sizesPath = implode('.', [ - 'backendlayouts', - $this->identifier, - 'columns', - ]); - - $columns = $this->configurationManager->getByPath($sizesPath); - assert(is_array($columns)); - $this->columns = array_map(static fn ($column): int => (int) $column, array_keys($columns)); - } -} diff --git a/Classes/Sizes/ContentElement.php b/Classes/Sizes/ContentElement.php deleted file mode 100644 index 209f038..0000000 --- a/Classes/Sizes/ContentElement.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. - */ - -class ContentElement extends AbstractContentElement -{ - public function __construct( - array $data, - private readonly string $fieldName - ) { - parent::__construct($data); - - $this->scalingConfiguration = $this->readConfigurationByPath( - implode('.', [ - 'contentelements', - $this->contentType, - $this->fieldName, - ]) - ); - } -}