Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safe\DateTimeImmutable is not compatible with \DatePeriod #235

Open
Kharhamel opened this issue Sep 3, 2020 · 0 comments
Open

Safe\DateTimeImmutable is not compatible with \DatePeriod #235

Kharhamel opened this issue Sep 3, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Kharhamel
Copy link
Collaborator

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.

@shish shish added the enhancement New feature or request label Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants