2 declare(strict_types
=1);
3 namespace TYPO3\CMS\Core\Imaging\ImageManipulation
;
6 * This file is part of the TYPO3 CMS project.
8 * It is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU General Public License, either version 2
10 * of the License, or any later version.
12 * For the full copyright and license information, please read the
13 * LICENSE.txt file that was distributed with this source code.
15 * The TYPO3 project - inspiring people to share!
33 public function __construct(string $id, string $title, float $value)
36 $this->title
= $title;
37 $this->value
= $value;
43 public function getId(): string
49 * @param array $config
51 * @throws \TYPO3\CMS\Core\Imaging\ImageManipulation\InvalidConfigurationException
53 public static function createMultipleFromConfiguration(array $config): array
57 foreach ($config as $id => $ratioConfig) {
60 $ratioConfig['title'],
64 } catch (\Throwable
$throwable) {
65 throw new InvalidConfigurationException(sprintf('Invalid type for ratio id given: %s', $throwable->getMessage()), 1486313971, $throwable);
74 public function asArray(): array
78 'title' => $this->title
,
79 'value' => $this->value
,