Devuelve el siguiente elemento en la iteracción

@param mixed $response

@return callable|null
509997
public function next($response): ?callable
    {
        if ($this->isEmpty()) {
            return null;
        }

        if (!is_null($response)) {
            return null;
        }

        return $this->pop();
    }
880174
private static function getHeaderAndBody($response) {
    $header = self::http_parse_headers(substr($response, 0, strrpos($response,"\r\n\r\n")));
    $body = substr($response, strrpos($response,"\r\n\r\n")+4);

    return array($header,$body);
  }
900934
public function format($response)
    {
        $this->isNew = false;
        $responseObject = new Response();
        $responseObject->setRawResponse($response);

        if ($responseObject->containsResults()) {
            $this->extractResults($response);
            $this->prepareResultSet();
            $this->prepareNodesByLabels();
            $this->prepareRelationshipsByType();
            $this->processIdentification($response);
        }

        if ($responseObject->containsRows()) {
            $rows = $this->formatRows($response);
            $responseObject->setRows($rows);

            if ($responseObject->containsResults()) {
                foreach ($responseObject->geRows() as $k => $v) {
                    if (!$this->result->hasIdentifier($k)) {
                        $this->result->addIdentifierValue($k, $v);
                    }
                }
            }
        }

        if (is_array($responseObject->geRows())) {
            $this->processTableFormat($responseObject->geRows());
        }
        $responseObject->setResult($this->result);

        $this->reset();

        return $responseObject;
    }
22057
protected function mimeTypeByResponse(Response $response)
    {
        $mimeType = $response->getHeader('Content-Type', false);
        if (count($mimeType) > 0) {
            $mimeType = array_pop($mimeType);
            $mimeType = explode(';', $mimeType);
            $mimeType = trim(array_shift($mimeType));

            if ('text/plain' !== strtolower($mimeType)) {
                return $mimeType;
            }
        }

        return null;
    }
650802
protected function _result($response)
    {
        $this->_info();

        $this->curl->close();

        $this->_default();

        if( Json::check($response) )
        {
            return json_decode($response);
        }
        elseif( XML\Check::check($response) )
        {
            return XML\Parser::simple($response);
        }
        else
        {
            return $response;
        }
    }
837845
protected function handleBulkResponse(string $response): ?string
	{
		if($response === '$-1')
		{
			return null;
		}

		$length = (int) substr($response, 1);

		return substr($this->connection->read($length + static::CRLF_LENGTH), 0, - static::CRLF_LENGTH);
	}
948232
public function dispatchResponse($response)
    {
        $parts = explode("\r\n\r\n", $response, 2);

        if (count($parts) < 2) {
            $this->throwException();
        }

        list($headersAsString, $body) = $parts;

        $headers = explode("\r\n", $headersAsString);
        list($code, $status) = $this->dispatchHttpStatus(array_shift($headers));
        $headers = $this->dispatchHeaders($headers);

        /** @var Emagedev_Utils_Model_Curl_Response $responseObject */
        $responseObject = Mage::getModel('emagedev_utils/curl_response');

        return $responseObject->setData(
            array(
                'code' => $code,
                'status' => $status,
                'headers_as_string' => $headersAsString,
                'headers' => $headers,
                'body' => $body
            )
        );
    }
1179292
protected function modifyResponse(array $response = array())
    {
        if (!empty($response['html']))
        {
            $replace = array('<![CDATA[' => '', ']]>' => '', '\'' => '"');
            $response['html'] = str_ireplace(array_keys($replace), array_values($replace), $response['html']);
        }

        return $response;
    }
329426
protected function fetchResponseError($response)
	{
		if (isset($response['error-code'])) {
			return [
				'code' => $response['error-code'],
				'message' => $response['message'],
			];
		} else if (isset($response['errorCode'])) {
			return [
				'code' => $response['errorCode'],
				'message' => $response['message'],
			];
		}
		return null;
	}
428368
public static function create($response)
    {
        Validate::isString($response, 'response');

        $wrapAccessTokenResult = new self();
        parse_str($response, $parsedResponse);

        $wrapAccessTokenResult->setAccessToken(
            Utilities::tryGetValue(
                $parsedResponse, Resources::WRAP_ACCESS_TOKEN
            )
        );

        $wrapAccessTokenResult->setExpiresIn(
            Utilities::tryGetValue(
                $parsedResponse, Resources::WRAP_ACCESS_TOKEN_EXPIRES_IN
            )
        );

        return $wrapAccessTokenResult;
    }
773806
protected function getResponseBody($response)
    {
        //Response must be string
        $body = $response;

        if ($response instanceof ResponseInterface) {
            //Fetch the body
            $body = $response->getBody();
        }

        if ($body instanceof StreamInterface) {
            $body = $body->getContents();
        }

        return (string) $body;
    }
1329921
protected function getErrorCode($response)
    {
        $code = Arr::get($response['error'], 'code', 'PaymentException');
        if (!isset($this->errorCodeMap[$code])) {
            $code = 'PaymentException';
        }

        return new ErrorCode($this->errorCodeMap[$code]);
    }
498998
public function transform($response): Collection
    {
        $dom = simplexml_load_string($response);

        $elements = collect(json_decode(json_encode($dom), true));

        return $elements;
    }
680650
public function after($response)
	{
		// return the template if no response is present and this isn't a RESTful call
		if ( ! $this->is_restful())
		{
			// do we have a response passed?
			if ($response === null)
			{
				// maybe one in the rest body?
				$response = $this->response->body;
				if ($response === null)
				{
					// fall back to the defined template
					$response = $this->template;
				}
			}

			// deal with returned array's in non-restful calls
			elseif (is_array($response))
			{
				$response = \Format::forge()->to_json($response, true);
			}

			// and make sure we have a valid Response object
			if ( ! $response instanceof Response)
			{
				$response = \Response::forge($response, $this->response_status);
			}
		}

		return parent::after($response);
	}
350603
public function filter($response)
    {
        $filter = $this->_request->getParam(static::FILTER_PARAMETER);
        if (!is_string($filter)) {
            return $response;
        }
        $filterArray = $this->parse($filter);
        if ($filterArray === null) {
            return $response;
        }
        $partialResponse = $this->applyFilter($response, $filterArray);
        return $partialResponse;
    }
563262
public function parse_tag_response( $response ) {
		if ( $this->validate_response( $response ) ) {
			return $response;
		}

		$arr = [];
		array_map(
			function ( $e ) use ( &$arr ) {
				$arr[] = $e->name;

				return $arr;
			},
			(array) $response
		);

		return $arr;
	}
709060
protected function decode($response)
    {
        $this->decoder = $this->decoder ?: new XmlrpcDecoder();

        return $this->decoder->decodeResponse($response);
    }