Skip to content

Commit 9750a8a

Browse files
committed
fix: necessary to work with PHP < 8.2
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 90d7d9e commit 9750a8a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Service/CrlService.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@ private static function isValidReasonCode(int $reasonCode): bool {
3535

3636
public function revokeCertificate(
3737
int $serialNumber,
38-
int $reasonCode = CRLReason::UNSPECIFIED->value,
38+
?int $reasonCode = null,
3939
?string $reasonText = null,
4040
?string $revokedBy = null,
4141
?DateTime $invalidityDate = null,
4242
): bool {
43+
if ($reasonCode === null) {
44+
$reasonCode = CRLReason::UNSPECIFIED->value;
45+
}
4346
if (!self::isValidReasonCode($reasonCode)) {
4447
throw new \InvalidArgumentException("Invalid CRLReason code: {$reasonCode}");
4548
}

0 commit comments

Comments
 (0)