public static function Bytes::toInt in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Component/Utility/Bytes.php \Drupal\Component\Utility\Bytes::toInt()
Parses a given byte size.
Parameters
mixed $size: An integer or string size expressed as a number of bytes with optional SI or IEC binary unit prefix (e.g. 2, 3K, 5MB, 10G, 6GiB, 8 bytes, 9mbytes).
Return value
int An integer representation of the size in bytes.
Deprecated
in drupal:9.1.0 and is removed from drupal:10.0.0. Use \Drupal\Component\Utility\Bytes::toNumber() instead
See also
https://www.drupal.org/node/3162663
1 call to Bytes::toInt()
- BytesTest::testToInt in core/
tests/ Drupal/ Tests/ Component/ Utility/ BytesTest.php - Tests \Drupal\Component\Utility\Bytes::toInt().
File
- core/
lib/ Drupal/ Component/ Utility/ Bytes.php, line 75
Class
- Bytes
- Provides helper methods for byte conversions.
Namespace
Drupal\Component\UtilityCode
public static function toInt($size) {
@trigger_error('\\Drupal\\Component\\Utility\\Bytes::toInt() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use \\Drupal\\Component\\Utility\\Bytes::toNumber() instead. See https://www.drupal.org/node/3162663', E_USER_DEPRECATED);
return self::toNumber($size);
}