public static function guessType($file)
    {
        $ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));

        switch (true) {
            case $ext === 'json':
            case basename($file) === 'composer.lock':
                return self::JSON;
            case $ext === 'yml':
            case $ext === 'yaml':
                return self::YAML;
            case $ext === 'ini':
            case basename($file) === '.my.cnf':
                return self::INI;
        }

        return null;
    }