Skip to content

Commit fbdee39

Browse files
refactor: rename DocMdpLevel enum cases to match JSignPdf naming
- NOT_CERTIFIED (was NONE) - CERTIFIED_NO_CHANGES_ALLOWED (was NO_CHANGES) - CERTIFIED_FORM_FILLING (was FORM_FILL) - CERTIFIED_FORM_FILLING_AND_ANNOTATIONS (was FORM_FILL_AND_ANNOTATIONS) This aligns enum case names with JSignPdf -cl parameter values, allowing direct use of enum->name without conversion layer. Signed-off-by: Vitor Mattos <[email protected]>
1 parent 7228fc6 commit fbdee39

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

lib/Enum/DocMdpLevel.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,30 @@
1212
use OCP\IL10N;
1313

1414
enum DocMdpLevel: int {
15-
case NONE = 0;
16-
case NO_CHANGES = 1;
17-
case FORM_FILL = 2;
18-
case FORM_FILL_AND_ANNOTATIONS = 3;
15+
case NOT_CERTIFIED = 0;
16+
case CERTIFIED_NO_CHANGES_ALLOWED = 1;
17+
case CERTIFIED_FORM_FILLING = 2;
18+
case CERTIFIED_FORM_FILLING_AND_ANNOTATIONS = 3;
1919

2020
public function isCertifying(): bool {
21-
return $this !== self::NONE;
21+
return $this !== self::NOT_CERTIFIED;
2222
}
2323

2424
public function getLabel(IL10N $l10n): string {
2525
return match($this) {
26-
self::NONE => $l10n->t('No certification'),
27-
self::NO_CHANGES => $l10n->t('No changes allowed'),
28-
self::FORM_FILL => $l10n->t('Form filling and additional signatures'),
29-
self::FORM_FILL_AND_ANNOTATIONS => $l10n->t('Form filling, annotations and additional signatures'),
26+
self::NOT_CERTIFIED => $l10n->t('No certification'),
27+
self::CERTIFIED_NO_CHANGES_ALLOWED => $l10n->t('No changes allowed'),
28+
self::CERTIFIED_FORM_FILLING => $l10n->t('Form filling and additional signatures'),
29+
self::CERTIFIED_FORM_FILLING_AND_ANNOTATIONS => $l10n->t('Form filling, annotations and additional signatures'),
3030
};
3131
}
3232

3333
public function getDescription(IL10N $l10n): string {
3434
return match($this) {
35-
self::NONE => $l10n->t('Document is not certified. No restrictions on modifications.'),
36-
self::NO_CHANGES => $l10n->t('No changes allowed. Additional approval signatures are prohibited.'),
37-
self::FORM_FILL => $l10n->t('Form filling allowed. Additional approval signatures are allowed.'),
38-
self::FORM_FILL_AND_ANNOTATIONS => $l10n->t('Form filling and annotations allowed. Additional approval signatures are allowed.'),
35+
self::NOT_CERTIFIED => $l10n->t('Document is not certified. No restrictions on modifications.'),
36+
self::CERTIFIED_NO_CHANGES_ALLOWED => $l10n->t('No changes allowed. Additional approval signatures are prohibited.'),
37+
self::CERTIFIED_FORM_FILLING => $l10n->t('Form filling allowed. Additional approval signatures are allowed.'),
38+
self::CERTIFIED_FORM_FILLING_AND_ANNOTATIONS => $l10n->t('Form filling and annotations allowed. Additional approval signatures are allowed.'),
3939
};
4040
}
4141
}

0 commit comments

Comments
 (0)