Closed aliowacom closed 2 years ago
There's an error, if you pass an empty PeriodCollection to overlap() or subtract() method since there's no check whether the collection actually has any values.
overlap()
subtract()
Steps to reproduce:
$period = Period::make('2021-12-31', '2022-01-01'); $collection = new PeriodCollection; $period->overlap(... $collection); // Throws ErrorException "Undefined array key 0" $period->subtract(... $collection); // Throws ErrorException "Undefined array key 0"
P.S. Thank you for your products and Merry Christmas! :)
Nice, could you also provide a test with this PR?
Done
Thanks!
Tagged: https://github.com/spatie/period/releases/tag/2.3.2
There's an error, if you pass an empty PeriodCollection to
overlap()
orsubtract()
method since there's no check whether the collection actually has any values.Steps to reproduce:
P.S. Thank you for your products and Merry Christmas! :)