safe icon indicating copy to clipboard operation
safe copied to clipboard

`Safe\DateTimeImmutable` is not compatible with `\DatePeriod`

Open Kharhamel opened this issue 5 years ago • 0 comments

As seen in #227, DatePeriod can take Safe\DateTimeImmutable as parameter but will mess its internal state and overall won't work correctly. The only workaround is to switch batch to \DateTimeImmutable with ->getInnerDateTime().

It would be nice to have a way to enforce this workaround, with a phpstan rule for example.

Kharhamel avatar Sep 03 '20 14:09 Kharhamel