Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sifex committed Jul 28, 2022
1 parent 3136984 commit 01eae45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Agenda/Weekly.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function addTimePeriod(string $start_time, string $end_time): Weekly

public function addTimePeriods(...$periods): Weekly
{
collect([$periods])->flatten()->each(function ($period) {
collect([$periods])->flatten(2)->each(function ($period) {
$this->addTimePeriod($period[0], $period[1]);
});

Expand Down
6 changes: 3 additions & 3 deletions src/SLA.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct(SLASchedule|array $schedules)
{
CarbonPeriod::mixin(EnhancedPeriod::class);

collect([$schedules])->flatten()->each(function ($b) {
collect([$schedules])->flatten(2)->each(function ($b) {
$this->addSchedule($b);
})->whenEmpty(function () {
$this->addSchedule(SLASchedule::create());
Expand All @@ -58,7 +58,7 @@ public function addBreach(SLABreach $breach): self

public function addBreaches(...$breaches): self
{
collect([$breaches])->flatten()->each(fn ($b) => $this->addBreach($b));
collect([$breaches])->flatten(2)->each(fn ($b) => $this->addBreach($b));

return $this;
}
Expand Down Expand Up @@ -86,7 +86,7 @@ public function clearPausePeriods(): self

public function addHolidays($dates): self
{
collect([$dates])->flatten()->each(fn ($d) => $this->addHoliday($d));
collect([$dates])->flatten(2)->each(fn ($d) => $this->addHoliday($d));

return $this;
}
Expand Down

0 comments on commit 01eae45

Please sign in to comment.