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.
Commits
4f991ed Fix mutation bug in diffInWeekdays() and diffInWeekendDays()
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps nesbot/carbon from 2.67.0 to 2.68.1.
Release notes
Sourced from nesbot/carbon's releases.
Commits
4f991ed
Fix mutation bug in diffInWeekdays() and diffInWeekendDays()cfb8701
Fix code styleae0ae7c
Add test message for mutability expectation757dd02
Add more tests for mixin mutability2358710
Fix code style9f0bb30
Respect mixin mutability13cb760
Update sponsorsd4c55bc
Merge pull request #2806 from axlon/fix-period-method-signaturese5c5b8e
FixCarbonPeriod
method signatures9b79266
Merge pull request #2805 from briannesbitt/test/compatibility-cleanupDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)