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

feat: D10 compatibility #197

Merged
merged 9 commits into from
Oct 10, 2023
Merged

feat: D10 compatibility #197

merged 9 commits into from
Oct 10, 2023

Conversation

marcoscano
Copy link
Collaborator

@marcoscano marcoscano commented Oct 4, 2023

Let's create a new major bumping all dependencies to be D10-only.

This was referenced Oct 4, 2023
@marcoscano marcoscano requested a review from e0ipso October 9, 2023 12:56
* \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.
Copy link
Collaborator Author

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.

Copy link
Member

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.

Copy link
Collaborator Author

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;
Copy link
Member

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.

Copy link
Member

@e0ipso e0ipso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge!

@marcoscano marcoscano merged commit 616adb6 into main Oct 10, 2023
@marcoscano marcoscano deleted the feat--d10-compatibility branch October 10, 2023 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants