public static function createFromArray($config)
    {
        if (!isset($config['stack'])) {
            throw new \RuntimeException('Stack has to be set');
        }
        $hash = isset($config['hash']) ? $config['hash'] : null;
        $format = isset($config['format']) ? $config['format'] : null;
        $filename = isset($config['filename']) ? $config['filename'] : null;

        return new self($config['stack'], $hash, $format, $filename);
    }