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
Showing with 4 additions and 10 deletions
+4 -10
...@@ -63,16 +63,10 @@ class Audit implements EndpointInterface ...@@ -63,16 +63,10 @@ class Audit implements EndpointInterface
*/ */
public function processAuditDeletion (array $auditSubTasks): array public function processAuditDeletion (array $auditSubTasks): array
{ {
$result = []; return array_values(array_map(
fn($task) => $this->processScheduledTask($task),
foreach ($auditSubTasks as $task) { array_filter($auditSubTasks, fn($task) => $this->gateway->statusAndScheduleCheck($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;
} }
/** /**
......
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