public static function fixDirectorySeparator(string $path, $useCleanPrefix = false) : string
    {
        /**
         * Trimming path string
         */
        if (($path = trim($path)) == '') {
            return $path;
        }

        $path = preg_replace('`(\/|\\\)+`', DIRECTORY_SEPARATOR, $path);
        if ($useCleanPrefix) {
            $path = DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR);
        }

        return $path;
    }
public static function fixDirectorySeparator(string $path, $useCleanPrefix = false) : string
    {
        /**
         * Trimming path string
         */
        if (($path = trim($path)) == '') {
            return $path;
        }

        $path = preg_replace('`(\/|\\\)+`', DIRECTORY_SEPARATOR, $path);
        if ($useCleanPrefix) {
            $path = DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR);
        }

        return $path;
    }
public static function fixDirectorySeparator ( string $ path , $ useCleanPrefix = false ) : string { /**
         * Trimming path string
         */ if ( ( $ path = trim ( $ path ) ) == '' ) { return $ path ; } $ path = preg_replace ( '`(\/|\\\)+`' , DIRECTORY_SEPARATOR , $ path ) ; if ( $ useCleanPrefix ) { $ path = DIRECTORY_SEPARATOR . ltrim ( $ path , DIRECTORY_SEPARATOR ) ; } return $ path ; }
Fix Path Separator

@param string $path
@param bool   $useCleanPrefix
@return string
Fix Path Separator