Skip to content

Commit

Permalink
Replaces foreach
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelstolt committed May 8, 2024
1 parent 0151220 commit 1b9f429
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Domain/PackageAnalyser.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ private function alternateStepStatus(string $stepId, ViolationStatus $status): v
throw new NonExistentStepId('Step id '.$stepId.' does not exist.');
}

foreach ($this->steps as $index => $step) {
if ($step['id'] === $stepId) {
array_walk($this->steps, function ($array, $index) use ($stepId, $status) {
if ($array['id'] === $stepId) {
$this->steps[$index]['status'] = $status;
}
}
});
}

/**
Expand Down

0 comments on commit 1b9f429

Please sign in to comment.