mirror of
https://github.com/LibreSign/libresign.git
synced 2025-12-17 21:12:16 +01:00
fix: use enum
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This commit is contained in:
parent
d725cc2a41
commit
d69708abdb
2 changed files with 4 additions and 2 deletions
|
|
@ -88,6 +88,7 @@ class Revoke extends Command {
|
|||
}
|
||||
|
||||
$reason = CRLReason::from($reasonCode);
|
||||
assert($reason instanceof CRLReason);
|
||||
$reasonDescription = $reason->getDescription();
|
||||
|
||||
$io->section('Revocation Details');
|
||||
|
|
@ -145,7 +146,7 @@ class Revoke extends Command {
|
|||
try {
|
||||
$success = $this->crlService->revokeCertificate(
|
||||
$serialNumber,
|
||||
$reason->value,
|
||||
$reason,
|
||||
$reasonText,
|
||||
'cli-admin'
|
||||
);
|
||||
|
|
|
|||
|
|
@ -111,6 +111,7 @@ class CrlApiController extends AEnvironmentAwareController {
|
|||
'message' => "Invalid reason code: {$reasonCode}. Must be between 0-10 (excluding 7).",
|
||||
], Http::STATUS_BAD_REQUEST);
|
||||
}
|
||||
assert($reason instanceof CRLReason);
|
||||
|
||||
$user = $this->userSession->getUser();
|
||||
$revokedBy = $user ? $user->getUID() : 'system';
|
||||
|
|
@ -118,7 +119,7 @@ class CrlApiController extends AEnvironmentAwareController {
|
|||
try {
|
||||
$success = $this->crlService->revokeCertificate(
|
||||
$serialNumber,
|
||||
$reason->value,
|
||||
$reason,
|
||||
$reasonText,
|
||||
$revokedBy
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue