protected static function unifyFiles($params, $data = '')
    {
        $type = $params['type'];
        $place = $params['place'];
        $routes = $params['routes'];
        $ext = ($type == 'style') ? '.css' : '.js';
        $hash = sha1(implode('', $params['files']));
        $minFile = $routes['path'] . $hash . $ext;

        if (! is_file($minFile) || self::$changes == true) {
            foreach ($params['paths'] as $id => $path) {
                if (isset($params['urls'][$id])) {
                    $url = $params['urls'][$id];
                    $path = $routes['path'] . $params['files'][$id];
                    $data .= self::saveExternalFile($url, $path);
                }
                $data .= file_get_contents($path);
            }
            $data = (self::$minify) ? self::compressFiles($data) : $data;

            self::saveFile($minFile, $data);
        }

        self::setProcessedFiles();

        return self::setNewParams($type, $place, $hash, $routes['url'], $ext);
    }