Skip to content

Safe\DateTimeImmutable is not compatible with \DatePeriod #235

Open
@Kharhamel

Description

@Kharhamel

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions