Add number of sheets as a unit for number of parts

This commit is contained in:
jrenslin committed 2025-01-14 11:12:40 +01:00
1 parent 709a5d5cc3
commit 1b34e49ff8
2 files changed
+5 -1

No files matched your search

+1 -1
Submodule l18n updated: 690f60a307...2619277713.
+4
View File
@@ -12,6 +12,7 @@
enum MDCountPartsUnit implements MDValueEnumInterface, JsonSerializable, MDMeasurementUnitInterface { enum MDCountPartsUnit implements MDValueEnumInterface, JsonSerializable, MDMeasurementUnitInterface {
case parts; case parts;
case sheets;
case pages; case pages;
/** /**
@@ -26,6 +27,7 @@ public static function fromString(string $input):MDCountPartsUnit {
return match($input) { return match($input) {
'parts' => self::parts, 'parts' => self::parts,
'pages' => self::pages, 'pages' => self::pages,
'sheets' => self::sheets,
default => throw new MDpageParameterNotFromListException("Unknown parts counting unit"), default => throw new MDpageParameterNotFromListException("Unknown parts counting unit"),
}; };
@@ -43,6 +45,7 @@ public static function fromInt(int $input):MDCountPartsUnit {
return match($input) { return match($input) {
1 => self::parts, 1 => self::parts,
2 => self::pages, 2 => self::pages,
3 => self::sheets,
default => throw new MDpageParameterNotFromListException("Unknown parts counting unit"), default => throw new MDpageParameterNotFromListException("Unknown parts counting unit"),
}; };
@@ -80,6 +83,7 @@ public function toInt():int {
return match($this) { return match($this) {
self::parts => 1, self::parts => 1,
self::pages => 2, self::pages => 2,
self::sheets => 3,
# default => throw new MDpageParameterNotFromListException("Unknown measurement type"), # default => throw new MDpageParameterNotFromListException("Unknown measurement type"),
}; };