Problem/Motivation
Follow up from #3142934-27: Replace \Drupal\Component\Utility\Bytes::toInt() with \Drupal\Component\Utility\Bytes::toNumber() due to return type comment #27
We would need to add a new toFloat() method instead, deprecate toInt(), and file a follow-up to remove in D10. But that would be a separate issue IMHO.
Very large bytes sizes (yottabytes, zettabytes) cannot be represented by an INT, not even in 64-bit PHP. Only FLOAT can support that magnitude.
Proposed resolution
Deprecate method Bytes::toInt() for removal in D10.
Add a Bytes::toNumber() that alwas returns a float.
Remaining tasks
None
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
None
Original report
Follow up from #3142934-27: Replace \Drupal\Component\Utility\Bytes::toInt() with \Drupal\Component\Utility\Bytes::toNumber() due to return type comment #27
Comments
Comment #2
mondrakeI'd rather suggest
Bytes::toNumber.Comment #3
mondrakeClosing in favor of the parent, which has been rescoped.