Parses scroll configuration from raw response.

@param array  $raw
@param string $scrollDuration

@return array
434587
public function getScrollConfiguration($raw, $scrollDuration)
    {
        $scrollConfig = [];
        if (isset($raw['_scroll_id'])) {
            $scrollConfig['_scroll_id'] = $raw['_scroll_id'];
            $scrollConfig['duration'] = $scrollDuration;
        }

        return $scrollConfig;
    }
161607
public function retrieveAll($raw = false)
    {
        if ($cache = $this->loadCache()) {
            if (!$raw) {
                $results = [];
                foreach ($cache as $key => $value) {
                    $results[$key] = unserialize($value['data']);
                }
                return $results;
            } else {
                return $cache;
            }
        }
        return null;
    }
728199
protected static function parseColumns(array $rawColumns, DataTablesWrapperInterface $wrapper) {

        $dtColumns = [];

        foreach ($rawColumns as $current) {

            $dtColumn = static::parseColumn($current, $wrapper);
            if (null === $dtColumn) {
                continue;
            }

            $dtColumns[] = $dtColumn;
        }

        return $dtColumns;
    }
336250
protected function handleResponse($raw){
        $data = json_decode($raw,true);

        if(!isset($data['status_code'])){
            return $raw;
        }

        if($data['status_code']>=300 || $data['status_code']<200){
            switch ($data['status_txt']) {
                case 'RATE_LIMIT_EXCEEDED':
                    throw new BitlyRateLimitException;
                    break;

                case 'INVALID_LOGIN':
                    throw new BitlyAuthException;
                    break;

                default:
                    throw new BitlyErrorException($data['status_txt']);
                    break;
            }
        }
        return $data;
    }
740713
public static function parseHeaders(string $raw_header): array
    {
        $raw_header = explode("\r\n\r\n", $raw_header);
        if (count($raw_header) > 1) {
            $headers = [];
            foreach ($raw_header as $header) {
                $headers[] = self::parseHeader($header);
            }

            return $headers;
        } else {
            return self::parseHeader($raw_header[0]);
        }
    }
639486
protected static function parseOrder(array $rawOrder) {

        $dtOrder = new DataTablesOrder();

        if (false === static::isValidRawOrder($rawOrder)) {
            return $dtOrder;
        }

        $dtOrder->setColumn(intval($rawOrder[DataTablesOrderInterface::DATATABLES_PARAMETER_COLUMN]));
        $dtOrder->setDir($rawOrder[DataTablesOrderInterface::DATATABLES_PARAMETER_DIR]);

        return $dtOrder;
    }
1320320
public function load($raw)
    {
        foreach (LogParser::parse($raw) as $entry) {
            list($level, $header, $stack) = array_values($entry);

            $this->push(new LogEntry($level, $header, $stack));
        }

        return $this;
    }
630318
public function parse($raw)
    {
        $lines = explode("\n", $raw);

        // Status Line
        preg_match('/HTTP\/(\d\.\d) (\d\d\d) (.*)/', $lines[0], $statusLine);
        $response = (new Response())
            ->withProtocolVersion($statusLine[1])
            ->withStatus($statusLine[2], $statusLine[3]);
        unset($lines[0]);

        // Headers
        foreach ($lines as $i => $line) {
            if ('' == trim($line)) {
                unset($lines[$i]);
                break;
            }
            $header   = explode(': ', $line);
            $response = $response->withHeader($header[0], $header[1]);
            unset($lines[$i]);
        }

        // Body
        $stream = new Stream(fopen('php://memory', 'rw+'));
        $stream->write(implode("\n", $lines));
        $stream->rewind();
        $response = $response->withBody($stream);

        return $response;
    }
1251750
function parseRequestData($rawInput = NULL)
    {
        try {

            if ($rawInput == NULL)
                throw new Exception ("Input must be defined", 503);

            $result = array();

            if (is_string($rawInput))
                $result = json_decode($rawInput, TRUE);

            if (is_array($rawInput))
                $result = $rawInput;

            if (is_object($rawInput))
                $result = json_decode(json_encode($rawInput), TRUE);

            return $result;

        } catch (Exception $e) {
            die("Exception raised: " . $e->getMessage() . "\nFile: " . $e->getFile() . "\nLine: " . $e->getLine());
        }
    }
1024358
protected function parse( $raw_handler, $default_method, $namespace ) {
		if ( $raw_handler instanceof Closure ) {
			return $raw_handler;
		}

		return $this->parseFromString( $raw_handler, $default_method, $namespace );
	}
547938
public static function fromRaw($raw){
			$response = new Response();

			$header_end_offset = strpos($raw, "\r\n\r\n");
			$raw_head = substr($raw, 0, $header_end_offset);
			$raw_body = substr($raw, $header_end_offset+4);
			$raw_headers = explode("\r\n", $raw_head);
			$status_head = array_shift($raw_headers);
			$status_segments = explode(" " , $status_head);

			$status = new stdClass();
			$status->protocol = $status_segments[0];
			$status->code = (int)$status_segments[1];
			$status->message = $status_segments[2];

			$headers = array();
			foreach($raw_headers as $header){
				$segments = explode(": ", $header, 2);
				$headers[$segments[0]] = $segments[1];
			}

			$response->status = $status;
			$response->headers = $headers;
			$response->body = $raw_body;

			return $response;
		}
236518
protected function getHeadersAsArray($rawHeaders)
    {
        $headers = [];

        foreach (explode("\r\n", (string) $rawHeaders) as $header) {
            if (false !== strpos($header, ':')) {
                list($name, $headerStr) = explode(':', $header, 2);
                $headers[trim($name)] = trim($headerStr);
            }
        }

        return $headers;
    }
312061
function parseTag(raw) {
	var cached = tagCache[raw];

	if (cached == null) {
		var tag, id, cls, attr;

		tagCache[raw] = cached = {
			tag:	(tag	= raw.match( /^[-\w]+/))		?	tag[0]						: "div",
			id:		(id		= raw.match( /#([-\w]+)/))		? 	id[1]						: null,
			class:	(cls	= raw.match(/\.([-\w.]+)/))		?	cls[1].replace(/\./g, " ")	: null,
			attrs:	null,
		};

		while (attr = RE_ATTRS.exec(raw)) {
			if (cached.attrs == null)
				{ cached.attrs = {}; }
			cached.attrs[attr[1]] = attr[2] || "";
		}
	}

	return cached;
}
836372
protected function parseResponse(array $responseRaw = [])
    {
        $result = [];

        if (count($responseRaw) === 0) {
            return $result;
        } elseif (strpos($responseRaw[0], '%PDF-') !== false) {
            return ['rawResponse' => base64_encode(implode("\n", array_values($responseRaw)))];
        }

        foreach ($responseRaw as $key => $line) {
            $pos = strpos($line, '=');

            if ($pos === false) {
                if (strlen($line) > 0) {
                    $result[$key] = $line;
                }
                continue;
            }

            $lineArray = explode('=', $line);
            $resultKey = array_shift($lineArray);
            $result[$resultKey] = implode('=', $lineArray);
        }

        return $result;
    }
500711
async function parseDocument(rawData) {
  try {
    return utils.unthrowableParseJson(rawData) || SwaggerParser.YAML.parse(rawData);
  } catch (err) {
    return null;
  }
}
246037
public function rawResponseToArray($responseRaw, $format)
    {
        $responseDecoded = [];
        if (!empty(trim($responseRaw))) {
            switch ($format) {
                case 'json':
                    $responseDecoded = $this->rawJsonToArray($responseRaw);
                    break;
                case 'xml':
                    $responseDecoded = $this->rawXmlToArray($this->lastCurlResponse);
                    break;
                case 'txt':
                default:
                    $responseDecoded = [$this->lastCurlResponse];
                    break;
            }
        }
        return $responseDecoded;
    }
363071
private function getContentLines(array $rawLines, string $commentCharacter) : array
    {
        $lines = [];

        foreach($rawLines as $line) {
            if(!isset($line{0}) || $line{0} !== $commentCharacter) {
                $lines[] = $line;
            }
        }

        return $lines;
    }