dunglas / doctrine-json-odm

An object document mapper for Doctrine ORM using JSON types of modern RDBMS.
https://dunglas.fr
MIT License
580 stars 64 forks source link

Add return types to support Symfony 6 #102

Closed ddeboer closed 2 years ago

ddeboer commented 2 years ago

BREAKING CHANGE: requires PHP 8.0 for union types.

Fix #99, ref #101.

ddeboer commented 2 years ago

@dunglas This PR adds return types in all places where Symfony 6 has them.

Do you mean adding return types too where Symfony/Doctrine don’t (yet) have them but only have PHPDoc @return annotations?

dunglas commented 2 years ago

Yes! But I can handle it.

ddeboer commented 2 years ago

No worries, I’ll add it here.

to not have to introduce new BC breaks later for the same reason.

Adding return types is no BC break, except for users extending this library, but this library’s Serializer and JsonDocumentType classes are final.

So this PR currently isn’t a break because of the return types themselves but because of the fact that PHP 8 is required for return types in general. I’m not even sure that has to count as a BC break.

ddeboer commented 2 years ago

@dunglas Done.

hhamon commented 2 years ago

Travis CI file must also be updated as well to remove support for PHP 7.x versions right?

ddeboer commented 2 years ago

@hhamon See #103 for the build pipeline.

dunglas commented 2 years ago

I crafted an alternative patch allowing to support both PHP 7.1 and Symfony 6: https://github.com/dunglas/doctrine-json-odm/pull/110