Skip to content

Commit

Permalink
Update CHANGELOG and rename parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
brendt committed Mar 24, 2021
1 parent f4ea452 commit 7e7b965
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to `period` will be documented in this file

## 2.1.0 - 2021-03-24

- Add `PeriodCollection::subtract(PeriodCollection|Period $others)` (#84)
- Rename parameter `PeriodCollection::overlap(PeriodCollection $others)`
- Rename parameter `PeriodCollection::overlapAll(PeriodCollection ...$others)`

## 2.0.0 - 2021-03-17

- Bump required PHP version to `^8.0`
Expand Down
8 changes: 4 additions & 4 deletions src/PeriodCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,17 @@ public function subtract(PeriodCollection | Period $others): static
return $collection;
}

private function overlap(PeriodCollection $periodCollection): PeriodCollection
private function overlap(PeriodCollection $others): PeriodCollection
{
$overlaps = new PeriodCollection();

foreach ($this as $period) {
foreach ($periodCollection as $otherPeriod) {
if (! $period->overlap($otherPeriod)) {
foreach ($others as $other) {
if (! $period->overlap($other)) {
continue;
}

$overlaps[] = $period->overlap($otherPeriod);
$overlaps[] = $period->overlap($other);
}
}

Expand Down

0 comments on commit 7e7b965

Please sign in to comment.