src/Configuration/Config.php
/**
     * This function transforms the php.ini notation for numbers (like '2M') to an integer (2*1024*1024 in this case)
     */
This function transforms the php.ini notation for numbers (like '2M') to an integer (2*1024*1024 in this case)
This function transforms the php . ini notation for numbers ( like ' 2M ' ) to an integer ( 2 * 1024 * 1024 in this case )
public static function convertPHPSizeToBytes(string $size): int
    {
        $suffix = mb_strtoupper(mb_substr($size, -1));
        if (! in_array($suffix, ['P', 'T', 'G', 'M', 'K'], true)) {
            return (int) $size;
        }
        $value = (int) mb_substr($size, 0, -1);
        switch ($suffix) {
            case 'P':
                $value *= 1024;
            case 'T':
                $value *= 1024;
            case 'G':
                $value *= 1024;
            case 'M':
                $value *= 1024;
            case 'K':
                $value *= 1024;
                break;
        }
        return $value;
    }
public static function convertPHPSizeToBytes ( string $ size ) : int { $ suffix = mb_strtoupper ( mb_substr ( $ size , - 1 ) ) ; if ( ! in_array ( $ suffix , [ 'P' , 'T' , 'G' , 'M' , 'K' ] , true ) ) { return ( int ) $ size ; } $ value = ( int ) mb_substr ( $ size , 0 , - 1 ) ; switch ( $ suffix ) { case 'P' : $ value *= 1024 ; case 'T' : $ value *= 1024 ; case 'G' : $ value *= 1024 ; case 'M' : $ value *= 1024 ; case 'K' : $ value *= 1024 ; break ; } return $ value ; }
This function transforms the php.ini notation for numbers (like '2M') to an integer (2*1024*1024 in this case)
This function transforms the php . ini notation for numbers ( like ' 2M ' ) to an integer ( 2 * 1024 * 1024 in this case )
// no break // no break // no break // no break