Skip to content

Commit

Permalink
mvc: style sweep/magic number avoidance
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Mar 12, 2024
1 parent 895edd3 commit 64e5236
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class CrlController extends ApiControllerBase
'3' => 'affiliationChanged',
'4' => 'superseded',
'5' => 'cessationOfOperation',
'6' => 'certificateHold'
'6' => 'certificateHold',
];

public function searchAction()
Expand Down Expand Up @@ -120,7 +120,7 @@ public function getAction($caref)
'selected' => $crlmethod == 'existing' ? '1' : '0'
],
];
for ($i = 0; $i <= 6; $i++) {
for ($i = 0; $i < count($status_codes); $i++) {
$code = (string)$i;
$result['revoked_reason_' . $code] = [];
foreach ($certs as $ref => $data) {
Expand Down Expand Up @@ -169,7 +169,7 @@ public function setAction($caref)
return ['status' => 'failed', 'validations' => $validations];
} else {
$revoked_refs = [];
for ($i = 0; $i <= 6; $i++) {
for ($i = 0; $i <= count($status_codes); $i++) {
$fieldname = 'revoked_reason_' . (string)$i;
foreach (explode(',', $payload[$fieldname] ?? '') as $refid) {
if (!empty($refid)) {
Expand Down

0 comments on commit 64e5236

Please sign in to comment.