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

Fix mappings involving DateTimeInterface type #26

Merged
merged 6 commits into from
Dec 20, 2023

Conversation

priyadi
Copy link
Contributor

@priyadi priyadi commented Dec 20, 2023

A mapping from DateTimeInterface $timeCreated to DateTimeInterface $timeCreated will result in an error if the source variable is an instance of DateTimeImmutable:

DateTimeImmutable::createFromMutable(): Argument #1 ($object) must be of type DateTime, DateTimeImmutable given

This fixes the problem by using DateTimeImmutable::createFromInterface.

Also included complete permutations between all the possible DateTime types.

@Korbeil
Copy link
Member

Korbeil commented Dec 20, 2023

Thanks a lot for your first PR @priyadi 🎉
Could you fix CS ? You can run it locally by doing: tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.php (You have to composer update inside tools/php-cs-fixer/ first)
Also, you will need to add a quick note about your changes into the CHANGELOG 🙏

@priyadi
Copy link
Contributor Author

priyadi commented Dec 20, 2023

@Korbeil done

@Korbeil
Copy link
Member

Korbeil commented Dec 20, 2023

@Korbeil done

Could you also add a note in the CHANGELOG about your changes ? 🙏

Copy link
Member

@Korbeil Korbeil left a comment

Choose a reason for hiding this comment

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

Thanks a lot for your contribution ! ❤️

@Korbeil Korbeil merged commit d12d47d into jolicode:main Dec 20, 2023
5 checks passed
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.

None yet

2 participants