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

For discussion: should we return DateTime or DateTimeImmutable? #296

Open
g105b opened this issue Mar 15, 2024 · 0 comments
Open

For discussion: should we return DateTime or DateTimeImmutable? #296

g105b opened this issue Mar 15, 2024 · 0 comments
Labels

Comments

@g105b
Copy link
Member

g105b commented Mar 15, 2024

$dateFrom = $input->getDateTime("date-from");

What type of DateTime should this library return in this case? I like the simplicity of DateTime, and with it being a getter it probably doesn't matter about immutability of the object itself, but would it make more sense or would it potentially confuse someone if the returned object was DateTimeImmutable?

@g105b g105b added the question label Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

1 participant