From d3d0cac865419515f3168f5eb861c12e773b1389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=A4drich?= <11225821+shaedrich@users.noreply.github.com> Date: Fri, 20 Dec 2024 11:09:29 +0100 Subject: [PATCH] Replace array_walk() with array_map() Since array_walk() requires its arguments to be passed by reference --- src/Illuminate/Console/Scheduling/ManagesFrequencies.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Illuminate/Console/Scheduling/ManagesFrequencies.php b/src/Illuminate/Console/Scheduling/ManagesFrequencies.php index 6e44d33d9f1..15db7cfdf55 100644 --- a/src/Illuminate/Console/Scheduling/ManagesFrequencies.php +++ b/src/Illuminate/Console/Scheduling/ManagesFrequencies.php @@ -389,11 +389,11 @@ public function twiceDailyAt($first = 1, $second = 13, $offset = 0) protected function hourBasedSchedule($minutes, $hours) { if (is_array($hours) || is_int($hours)) { - array_walk((array) $hours, $this->validateHour(...)); + array_map($this->validateHour(...), (array) $hours); } if (is_array($minutes) || is_int($minutes)) { - array_walk((array) $minutes, $this->validateMinute(...)); + array_map($this->validateMinute(...), (array) $minutes); } $minutes = is_array($minutes) ? implode(',', $minutes) : $minutes; @@ -558,7 +558,7 @@ public function monthlyOn($dayOfMonth = 1, $time = '0:0') */ public function twiceMonthly($first = 1, $second = 16, $time = '0:0') { - array_walk([$first, $second], $this->validateDayOfMonth(...)); + array_map($this->validateDayOfMonth(...), [$first, $second]); $daysOfMonth = $first.','.$second; @@ -653,7 +653,7 @@ public function days($days) { $days = is_array($days) ? $days : func_get_args(); - array_walk($days, $this->validateDayOfWeek(...)); + array_map($this->validateDayOfWeek(...), $days); return $this->spliceIntoPosition(5, implode(',', $days)); }