core/includes/bootstrap.inc | 8 ++++---- core/includes/common.inc | 17 ++++++++--------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index a560d53..9770bbf 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -3051,7 +3051,7 @@ function _drupal_shutdown_function() { * Returns the maximum amount of memory in bytes that Drupal is allowed to * allocate. * - * @return + * @return int|null * The number of bytes, or NULL if there is no limit. */ function drupal_memory_limit() { @@ -3068,16 +3068,16 @@ function drupal_memory_limit() { /** * Compares the memory required for an operation to the available memory. * - * @param $required + * @param int $required * The memory required for the operation, expressed as a number of bytes with * optional SI or IEC binary unit prefix (e.g. 2, 3 K, 5MB, 10 G, 6GiB, 8 * bytes, 9mbytes). - * @param $memory_limit + * @param int $memory_limit * (optional) The memory limit for the operation, expressed as a number of * bytes with optional SI or IEC binary unit prefix. If no value is passed, * the current PHP memory_limit will be used. * - * @return + * @return bool * TRUE if there is sufficient memory to allow the operation, or FALSE * otherwise. */ diff --git a/core/includes/common.inc b/core/includes/common.inc index 89c54e0..ad17c0c 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -973,15 +973,15 @@ function format_plural($count, $singular, $plural, array $args = array(), array * * See https://en.wikipedia.org/wiki/Binary_prefix for more information. * - * @param $count + * @param string $count * A byte count expressed as a numeric quantity, optionally followed by a * unit: * - SI (powers of 1000), e.g. 7.4kB, 8 MB, 42.9 megabytes, 9 G, 1terabyte. * - IEC (powers of 1024), e.g. 9 Kibibytes, 0.3 MiB, 40gibibytes. - * @param $force_iec + * @param bool $force_iec * Override the unit type detection to be IEC. Defaults to FALSE. * - * @return + * @return int * An integer representation of the byte count. * * @see format_byte_count() @@ -1009,9 +1009,8 @@ function parse_byte_count($count, $force_iec = FALSE) { // FALSE which is cast to 0. This causes the unit to default to 'b'. $quantity *= pow($base, (int) strpos('bkmgtpezy', $unit[0])); } - // Make sure an integer is returned. Not cast to an integer type as this would - // limit the maximum to 2 GiB on 32-bit platforms. - return floor($quantity); + // Make sure an integer is returned. + return (int) floor($quantity); } /** @@ -1019,12 +1018,12 @@ function parse_byte_count($count, $force_iec = FALSE) { * * See https://en.wikipedia.org/wiki/Binary_prefix for more information. * - * @param $count + * @param int $count * An integer byte count. - * @param $iec + * @param bool $iec * Format as IEC instead of SI. Defaults to FALSE. * - * @return + * @return string * A human readable representation of the byte count, e.g. * - SI (powers of 1000) 7.4 kB, 8 MB, 42.9 MB, 9 GB, 1 TB. * - IEC (powers of 1024) 9 KiB, 0.3 MiB, 40 GiB.