public static function createTransformFilestring($transform): string
    {
        $r = '';

        foreach ($transform as $k => $v) {
            if ($k === 'effects' || $k === 'preEffects') {
                $effectString = '';
                foreach ($v as $eff => $param) {
                    if (\is_array($param)) {
                        if (\is_array($param[0])) {
                            $effectString .= '_' . $eff;
                            foreach ($param as $paramArr) {
                                $effectString .= '-' . implode('-', $paramArr);
                            }
                        } else {
                            $effectString .= '_' . $eff . '-' . implode('-', $param);
                        }
                    } else {
                        $effectString .= '_' . $eff . '-' . $param;
                    }
                }

                $r .= '_' . (ImagerService::$transformKeyTranslate[$k] ?? $k) . $effectString;
            } else {
                if ($k === 'watermark') {
                    $watermarkString = '';

                    foreach ($v as $eff => $param) {
                        $watermarkString .= $eff . '-' . (\is_array($param) ? implode('-', $param) : $param);
                    }

                    $r .= '_' . (ImagerService::$transformKeyTranslate[$k] ?? $k) . '_' . mb_substr(md5($watermarkString), 0, 10);
                } elseif ($k === 'webpImagickOptions') {
                    $optString = '';

                    foreach ($v as $optK => $optV) {
                        $optString .= ($optK . '-' . $optV . '-');
                    }

                    $r .= '_' . (ImagerService::$transformKeyTranslate[$k] ?? $k) . '_' . mb_substr($optString, 0, strlen($optString) - 1);
                } else {
                    $r .= '_' . (ImagerService::$transformKeyTranslate[$k] ?? $k) . (\is_array($v) ? implode('-', $v) : $v);
                }
            }
        }

        return str_replace([' ', '.', ',', '#', '(', ')'], ['-', '-', '-', '', '', ''], $r);
    }
public static function createTransformFilestring($transform): string
    {
        $r = '';

        foreach ($transform as $k => $v) {
            if ($k === 'effects' || $k === 'preEffects') {
                $effectString = '';
                foreach ($v as $eff => $param) {
                    if (\is_array($param)) {
                        if (\is_array($param[0])) {
                            $effectString .= '_' . $eff;
                            foreach ($param as $paramArr) {
                                $effectString .= '-' . implode('-', $paramArr);
                            }
                        } else {
                            $effectString .= '_' . $eff . '-' . implode('-', $param);
                        }
                    } else {
                        $effectString .= '_' . $eff . '-' . $param;
                    }
                }

                $r .= '_' . (ImagerService::$transformKeyTranslate[$k] ?? $k) . $effectString;
            } else {
                if ($k === 'watermark') {
                    $watermarkString = '';

                    foreach ($v as $eff => $param) {
                        $watermarkString .= $eff . '-' . (\is_array($param) ? implode('-', $param) : $param);
                    }

                    $r .= '_' . (ImagerService::$transformKeyTranslate[$k] ?? $k) . '_' . mb_substr(md5($watermarkString), 0, 10);
                } elseif ($k === 'webpImagickOptions') {
                    $optString = '';

                    foreach ($v as $optK => $optV) {
                        $optString .= ($optK . '-' . $optV . '-');
                    }

                    $r .= '_' . (ImagerService::$transformKeyTranslate[$k] ?? $k) . '_' . mb_substr($optString, 0, strlen($optString) - 1);
                } else {
                    $r .= '_' . (ImagerService::$transformKeyTranslate[$k] ?? $k) . (\is_array($v) ? implode('-', $v) : $v);
                }
            }
        }

        return str_replace([' ', '.', ',', '#', '(', ')'], ['-', '-', '-', '', '', ''], $r);
    }
public static function createTransformFilestring ( $ transform ) : string { $ r = '' ; foreach ( $ transform as $ k => $ v ) { if ( $ k === 'effects' || $ k === 'preEffects' ) { $ effectString = '' ; foreach ( $ v as $ eff => $ param ) { if ( \ is_array ( $ param ) ) { if ( \ is_array ( $ param [ 0 ] ) ) { $ effectString .= '_' . $ eff ; foreach ( $ param as $ paramArr ) { $ effectString .= '-' . implode ( '-' , $ paramArr ) ; } } else { $ effectString .= '_' . $ eff . '-' . implode ( '-' , $ param ) ; } } else { $ effectString .= '_' . $ eff . '-' . $ param ; } } $ r .= '_' . ( ImagerService :: $ transformKeyTranslate [ $ k ] ?? $ k ) . $ effectString ; } else { if ( $ k === 'watermark' ) { $ watermarkString = '' ; foreach ( $ v as $ eff => $ param ) { $ watermarkString .= $ eff . '-' . ( \ is_array ( $ param ) ? implode ( '-' , $ param ) : $ param ) ; } $ r .= '_' . ( ImagerService :: $ transformKeyTranslate [ $ k ] ?? $ k ) . '_' . mb_substr ( md5 ( $ watermarkString ) , 0 , 10 ) ; } elseif ( $ k === 'webpImagickOptions' ) { $ optString = '' ; foreach ( $ v as $ optK => $ optV ) { $ optString .= ( $ optK . '-' . $ optV . '-' ) ; } $ r .= '_' . ( ImagerService :: $ transformKeyTranslate [ $ k ] ?? $ k ) . '_' . mb_substr ( $ optString , 0 , strlen ( $ optString ) - 1 ) ; } else { $ r .= '_' . ( ImagerService :: $ transformKeyTranslate [ $ k ] ?? $ k ) . ( \ is_array ( $ v ) ? implode ( '-' , $ v ) : $ v ) ; } } } return str_replace ( [ ' ' , '.' , ',' , '#' , '(' , ')' ] , [ '-' , '-' , '-' , '' , '' , '' ] , $ r ) ; }
Creates additional file string that is appended to filename

@param array $transform

@return string
Creates additional file string that is appended to filename