You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using int|string is done in a few places, but we can't set a return type of int because large (and valid) tags, etc may be above the machines PHP_INT_MAX. We could use a \GMP instance for these cases.
Not sure what you think about this one, API consumers would have to do it wherever they want to use a tag as a key - which we would have do in some places too (tag to tag name I think, plus some constants will just be integers..)
Let me know if it's too invasive to be worth the parameter / return type hints, otherwise I'll try write this up soon
The text was updated successfully, but these errors were encountered:
I've been done some thinking on that matter as well.
I made changes just a while back so that numbers that could be reasonably expected to have large values are represented internally as BigInt, which stores the number as a string. Furthermore i changed return values such that methods that used to return int|string now return integer number strictly as a string.
It doesn't feel right to require parameters as GMP or BigInt or any other object. I think for the fluency of the API we should accept untyped parameter in those places and leave the responsibility to the caller.
One possibility would be to introduce fromGMP, fromInt etc. methods, but would it bring any added value to the API?
Using int|string is done in a few places, but we can't set a return type of
int
because large (and valid) tags, etc may be above the machines PHP_INT_MAX. We could use a \GMP instance for these cases.Not sure what you think about this one, API consumers would have to do it wherever they want to use a tag as a key - which we would have do in some places too (tag to tag name I think, plus some constants will just be integers..)
Let me know if it's too invasive to be worth the parameter / return type hints, otherwise I'll try write this up soon
The text was updated successfully, but these errors were encountered: