vinkla / hashids

A small PHP library to generate YouTube-like ids from numbers. Use it when you don't want to expose your database ids to the user.
https://hashids.org/php
MIT License
5.29k stars 417 forks source link

Add declarations to functions In Bc.php file depend on what it return #167

Closed AbdlrahmanSaberAbdo closed 3 years ago

AbdlrahmanSaberAbdo commented 3 years ago

Add declarations to functions In Bc.php file depend on what it returns

The multiply function In the Bc.php file use bcmul function which returns a string so I add a string declaration to it.

The divide function In the Bc.php file use bcdiv function which returns a string/null so I add a string declaration with the possibility to be nullable (?string).

vinkla commented 3 years ago

Thanks for the pull request. I agree it would be good to add return types. It would most likely require a major release, which we aren't too keen on releasing for this kind of update. With that said, this pull request could stay open until we release a new major version. In that case, please update the Gmp and the MathInterface as well.

AbdlrahmanSaberAbdo commented 3 years ago

Thanks for the pull request. I agree it would be good to add return types. It would most likely require a major release, which we aren't too keen on releasing for this kind of update. With that said, this pull request could stay open until we release a new major version. In that case, please update the Gmp and the MathInterface as well.

Thank you Vinkla, I'll update them, but why it requires to make a more release? anyway if you're planning to make a new release let me know I want to help.

AbdlrahmanSaberAbdo commented 3 years ago

Thanks for the pull request. I agree it would be good to add return types. It would most likely require a major release, which we aren't too keen on releasing for this kind of update. With that said, this pull request could stay open until we release a new major version. In that case, please update the Gmp and the MathInterface as well.

Thank you Vinkla, I'll update them, but why it requires making a major release? anyway if you're planning to make a new release let me know I want to help.

vinkla commented 3 years ago

but why it requires to make a more release?

If someone has extended one of the math classes or the interface it could lead to problems since we haven't forced a return type previously.

vinkla commented 3 years ago

Closing this due to inactivity. If you still want to update the math classes, we can reopen this in the future.