]> git.mxchange.org Git - friendica.git/commitdiff
Update src/Util/Strings.php
authorMarekBenjamin <117765478+MarekBenjamin@users.noreply.github.com>
Sat, 26 Nov 2022 22:14:21 +0000 (23:14 +0100)
committerGitHub <noreply@github.com>
Sat, 26 Nov 2022 22:14:21 +0000 (23:14 +0100)
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
src/Util/Strings.php

index 7b8d999d3a6a577572ed73a07d54ec076e7d1999..0972e44486afc811236bb572d4360689db824d93 100644 (file)
@@ -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':