Commit 6c6ee4a7 authored by Oana-Eliza Alexa's avatar Oana-Eliza Alexa
Browse files

use maps

1 merge request!74Draft: Resolve "Redesign audit class"
Pipeline #32392 failed with stages
in 51 seconds
This commit is part of merge request !74. Comments created here will be created in the context of that merge request.
Showing with 4 additions and 10 deletions
+4 -10
......@@ -63,16 +63,10 @@ class Audit implements EndpointInterface
*/
public function processAuditDeletion (array $auditSubTasks): array
{
$result = [];
foreach ($auditSubTasks as $task) {
// If the tasks must be treated - status and scheduled - process the sub-tasks
if ($this->gateway->statusAndScheduleCheck($task)) {
$result[] = $this->processScheduledTask($task);
}
}
return $result;
return array_values(array_map(
fn($task) => $this->processScheduledTask($task),
array_filter($auditSubTasks, fn($task) => $this->gateway->statusAndScheduleCheck($task))
));
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment