odolbeau / phone-number-bundle

Integrates libphonenumber into your Symfony application
MIT License
217 stars 43 forks source link

Adding return types everywhere #120

Closed Nek- closed 2 years ago

Nek- commented 2 years ago

This PR is about adding return types everywhere to get definitely rid of deprecation notice.

Since the code is battle-tested tests should highlight any place when it's wrong. The only class that was not tested is now tested!

This stands as a replacement for #109 .


Since we're using PHP 7.4 as the minimum requirement, there's no problem with this PR. However, the normalize() method of the normalizer has union return types. Luckily, we do not need it, so I added the return type string anyway.

Regarding the declare(strict_types=1), I think we should open an issue for version 4.x of the bundle, WDYT?

Nek- commented 2 years ago

@OskarStark thank you for your review. I fixed everything, and I even found one missing type addition! 👍

GLacourt commented 2 years ago

Yeah sorry was disconnected for a few weeks. It's ok for me thx. The purpose wasn't a BC break just try to keep up good practices and remove deprecation warning. Another way is to tag version of this bundle and base package to stick with new coding standard and php version. I'm fine with what you did and again thank you !