Complete commits list: 2.67.0...2.68.0
Summary:
- Added #2802 Support named arguments for mixins — @kylekatarnls
- Fixed #2806 Fix
CarbonPeriod
method signatures — @axlon - Fixed #2801 Use
CarbonImmutable
when creatingCarbonPeriodImmutable
— @kylekatarnls - Fixed #2799 Fix
diffInWeekdays
anddiffInWeekendDays
with partial days — @kylekatarnls - Fixed #2781 Change
@method shiftTimezone()
return tostatic
— @kylekatarnls - Fixed #2804 Restore type of mixin results using $this — @kylekatarnls
Breaking chances (for edge-case usages):
⚠️ Now mixin methods will respect mutability: for instance if you previously returned $this->modify()
or $this->setTimezone()
from within a mixin method, previously you got a copy of the object, now you will get the same object, modified. If you want to maintain the previous behavior, you'll have to explicitly call $date = $this->copy();
at the beginning at mixin methods and then modify and return this copied instance. Alternatively you can use CarbonImmutable
all way long so any modification (via macro, mixin or regular methods) will all create a new instance.
⚠️ Now CarbonPeriodImmutable
emit CarbonImmutable
objects on iteration, if you rely on receiving Carbon
and doing mutation on it, you should call now explicitly first ->toMutable()
.
⚠️ Now diffInWeekdays
and diffInWeekendDays
returned before rounded-up values which was inconsistent with other diff methods all returning rounded-down value. If you were using those methods with start and end dates not having the same hour/minute/second and were willingly expecting rounded-up values, you should now add + ($start->isSameAs('H:i:s.u', $end) ? 0 : 1)
to get the same result as before.