From 1b34e49ff8add2afa7ca521bb92f4b844566be7d Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Tue, 14 Jan 2025 11:12:40 +0100 Subject: [PATCH] Add number of sheets as a unit for number of parts --- l18n | 2 +- src/enums/MDCountPartsUnit.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/l18n b/l18n index 690f60a..2619277 160000 --- a/l18n +++ b/l18n @@ -1 +1 @@ -Subproject commit 690f60a307664723c088c8e9d517d9fcaa203a4a +Subproject commit 2619277713a8876a24015d800b843fbe71ae8f47 diff --git a/src/enums/MDCountPartsUnit.php b/src/enums/MDCountPartsUnit.php index bed501b..20eea64 100644 --- a/src/enums/MDCountPartsUnit.php +++ b/src/enums/MDCountPartsUnit.php @@ -12,6 +12,7 @@ declare(strict_types = 1); enum MDCountPartsUnit implements MDValueEnumInterface, JsonSerializable, MDMeasurementUnitInterface { case parts; + case sheets; case pages; /** @@ -26,6 +27,7 @@ enum MDCountPartsUnit implements MDValueEnumInterface, JsonSerializable, MDMeasu return match($input) { 'parts' => self::parts, 'pages' => self::pages, + 'sheets' => self::sheets, default => throw new MDpageParameterNotFromListException("Unknown parts counting unit"), }; @@ -43,6 +45,7 @@ enum MDCountPartsUnit implements MDValueEnumInterface, JsonSerializable, MDMeasu return match($input) { 1 => self::parts, 2 => self::pages, + 3 => self::sheets, default => throw new MDpageParameterNotFromListException("Unknown parts counting unit"), }; @@ -80,6 +83,7 @@ enum MDCountPartsUnit implements MDValueEnumInterface, JsonSerializable, MDMeasu return match($this) { self::parts => 1, self::pages => 2, + self::sheets => 3, # default => throw new MDpageParameterNotFromListException("Unknown measurement type"), };