b3fc145df629ced9904f7f2a8b5c00916c1fba99
On PHP 8.5, DateTimeImmutable::modify() warns when its result is discarded, but CarbonImmutable overrides it and lost the attribute. Override modify(), next(), previous() and __call() in CarbonImmutable with #[NoDiscard] so a discarded result warns again. The attribute is ignored on older PHP versions, and mutable Carbon is unchanged. Existing immutable tests that discarded results now keep them; in IsTest::testIsSameMonth this was a real slip, the loop never moved $dt. Fixes #3377
Description
My contributions to briannesbitt/Carbon: 3 commits, 1 merged PRs
121 KiB
0 Stars
1 Watchers
0 Forks
Languages
PHP
100%