From 765b50bde8cd2cb9e4f89fd67d81c1c1509b5261 Mon Sep 17 00:00:00 2001 From: MarekBenjamin <117765478+MarekBenjamin@users.noreply.github.com> Date: Sat, 26 Nov 2022 23:14:21 +0100 Subject: [PATCH] Update src/Util/Strings.php Co-authored-by: Hypolite Petovan --- src/Util/Strings.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Util/Strings.php b/src/Util/Strings.php index 7b8d999d3a..0972e44486 100644 --- a/src/Util/Strings.php +++ b/src/Util/Strings.php @@ -525,16 +525,16 @@ class Strings */ public static function getBytesFromShorthand(string $shorthand): int { - $shorthand = trim($shorthand); + $shorthand = trim($shorthand); - if (is_numeric($shorthand)) + if (is_numeric($shorthand)) { return $shorthand; + } - $last = strtolower($shorthand[strlen($shorthand)-1]); - $shorthand = substr($shorthand, 0, -1); // necessary since PHP 7.1; otherwise optional + $last = strtolower($shorthand[strlen($shorthand)-1]); + $shorthand = substr($shorthand, 0, -1); switch($last) { - // The 'G' modifier is available since PHP 5.1.0 case 'g': $shorthand *= 1024; case 'm':