From 5bcd4c0d4051a398d0630c3499272f36bf92013a Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 28 Jul 2022 15:35:19 +0100 Subject: [PATCH] wip --- src/Agenda/Weekly.php | 2 +- src/SLA.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Agenda/Weekly.php b/src/Agenda/Weekly.php index 493c457..898f346 100644 --- a/src/Agenda/Weekly.php +++ b/src/Agenda/Weekly.php @@ -24,7 +24,7 @@ public function addTimePeriod(string $start_time, string $end_time): Weekly public function addTimePeriods(...$periods): Weekly { - collect($periods)->flatten(1)->each(function ($period) { + collect($periods)->flatten(2)->each(function ($period) { $this->addTimePeriod($period[0], $period[1]); }); diff --git a/src/SLA.php b/src/SLA.php index fe46b24..c2427c5 100644 --- a/src/SLA.php +++ b/src/SLA.php @@ -42,7 +42,7 @@ public function __construct(SLASchedule|array $schedules) { CarbonPeriod::mixin(EnhancedPeriod::class); - collect([$schedules])->flatten(1)->each(function ($b) { + collect([$schedules])->flatten(2)->each(function ($b) { $this->addSchedule($b); })->whenEmpty(function () { $this->addSchedule(SLASchedule::create()); @@ -58,7 +58,7 @@ public function addBreach(SLABreach $breach): self public function addBreaches(...$breaches): self { - collect([$breaches])->flatten(1)->each(fn ($b) => $this->addBreach($b)); + collect([$breaches])->flatten(2)->each(fn ($b) => $this->addBreach($b)); return $this; } @@ -86,7 +86,7 @@ public function clearPausePeriods(): self public function addHolidays($dates): self { - collect([$dates])->flatten(1)->each(fn ($d) => $this->addHoliday($d)); + collect([$dates])->flatten(2)->each(fn ($d) => $this->addHoliday($d)); return $this; }