-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: D10 compatibility #197
Conversation
* \DateTimeInterface and we want to return a ConcreteDateTime object instead. | ||
* Unfortunately \DateTimeInterface can't be extended by user classes, so the | ||
* option we have is to unfortunately copy here most methods from | ||
* DateTimeNormalizer, and modify the ones that are particular to us here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unfortunately the only way I could find to workaround the fact that we can't extend \DateTimeInterface
but I would be happy to go into another direction if others can think of alternative approaches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to use a decorator pattern here? I think this is a perfect use case for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call! I'll give it a try. Thanks!
|
||
public function getSupportedTypes(?string $format): array | ||
{ | ||
return self::$supportedTypes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh! If you don't override here it won't work due to late static binding, right? I wish the decorated used static
instead of self
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge!
Let's create a new major bumping all dependencies to be D10-only.