private static function extractHeaders(array $headers, array $entries): array
    {
        $currentHeader = null;

        foreach ($headers as $header) {
            $header = \trim($header);
            $header = self::convertString($header);

            if ($header === '') {
                continue;
            }

            if (self::isHeaderDefinition($header)) {
                $header                             = \explode(':', $header, 2);
                $currentHeader                      = \trim($header[0]);
                $entries['headers'][$currentHeader] = \trim($header[1]);
            } else {
                $entries['headers'][$currentHeader] = [$entries['headers'][$currentHeader] ?? '', \trim($header)];
            }
        }

        return $entries;
    }