From 66fa3fca8323fe763e4177cc31d3f535802e976a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 18 Jan 2021 16:11:09 +0100 Subject: [PATCH] Add ratio to template creators MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- .../Files/Template/TemplateFileCreator.php | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/lib/public/Files/Template/TemplateFileCreator.php b/lib/public/Files/Template/TemplateFileCreator.php index eeca2f0c01..c41a6514ee 100644 --- a/lib/public/Files/Template/TemplateFileCreator.php +++ b/lib/public/Files/Template/TemplateFileCreator.php @@ -34,7 +34,11 @@ final class TemplateFileCreator implements \JsonSerializable { protected $actionName; protected $fileExtension; protected $iconClass; + protected $ratio = null; + /** + * @since 21.0.0 + */ public function __construct( string $appId, string $actionName, string $fileExtension ) { @@ -43,31 +47,55 @@ final class TemplateFileCreator implements \JsonSerializable { $this->fileExtension = $fileExtension; } + /** + * @since 21.0.0 + */ public function getAppId(): string { return $this->appId; } + /** + * @since 21.0.0 + */ public function setIconClass(string $iconClass): TemplateFileCreator { $this->iconClass = $iconClass; return $this; } + /** + * @since 21.0.0 + */ public function addMimetype(string $mimetype): TemplateFileCreator { $this->mimetypes[] = $mimetype; return $this; } + /** + * @since 21.0.0 + */ public function getMimetypes(): array { return $this->mimetypes; } + /** + * @since 21.0.0 + */ + public function setRatio(float $ratio) { + $this->ratio = $ratio; + return $this; + } + + /** + * @since 21.0.0 + */ public function jsonSerialize() { return [ 'app' => $this->appId, 'label' => $this->actionName, 'extension' => $this->fileExtension, 'iconClass' => $this->iconClass, - 'mimetypes' => $this->mimetypes + 'mimetypes' => $this->mimetypes, + 'ratio' => $this->ratio ]; } }