Sends data to the request parser.

@param string $data
495069
private function parse(string $data = "")
    {
        try {
            $promise = $this->requestParser->send($data);

            if ($promise instanceof Promise && !$this->isExported && !($this->status & self::CLOSED_RDWR)) {
                // Parser wants to wait until a promise completes.
                $this->paused = true;
                $promise->onResolve($this->resume); // Resume will set $this->paused to false if called immediately.
                if ($this->paused) { // Avoids potential for unnecessary disable followed by enable.
                    Loop::disable($this->readWatcher);
                }
            }
        } catch (\Throwable $exception) {
            // Parser *should not* throw an exception, but in case it does...
            $this->logger->critical($exception);
            $this->close();
        }
    }
1159353
public function setData($data)
    {
        $body = new Doozr_Response_Body();
        $body->write($data);

        $this->setBody($body);
    }
1006298
public function sendDataAsHtml($data) {
    $this->disableView();
    if (extension_loaded('xdebug')) {
      ob_start();
      var_dump($data);
      $output = ob_get_clean();
    }
    else {
      $output = sprintf(
          '<pre><code>%s</code></pre>',
          json_encode($data,JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT)
      );
    }
    $this->setContent($output);
    $this->send();
  }
1277685
protected function handlePost($data)
    {
        PWELogger::debug($_SERVER['REQUEST_METHOD'] . ": %s", $data);
        throw new HTTP5xxException('Not supported method for this call: ' . $_SERVER['REQUEST_METHOD'], HTTP5xxException::UNIMPLEMENTED);
    }
619671
public function sendDataAsJson($data) {
    $this->disableView();
    $this->setContentType('application/json', 'UTF-8');
    if (is_object($data)) {
      if (method_exists($data,'toArray'))
        $data = $data->toArray();
    }
    if (empty($data))
      $data = new \stdClass();
    
    $this->setJsonContent($data);
    $this->send();
  }
205261
public function sendData( $data )
    {
        if ( is_resource( $this->connection ) )
        {
            if ( fwrite( $this->connection, $data . self::CRLF,
                        strlen( $data ) + strlen( self::CRLF  ) ) === false )
            {
                throw new ezcMailTransportException( 'Could not write to the stream. It was probably terminated by the host.' );
            }
        }
    }
38564
protected function setBody($data)
    {
        $this->responseWriter->setBody($this->response, $data, $this->request);
    }
227485
public function jsonResponse($data)
    {
        $this->_headers[] = 'Content-Type: application/json';

        if (!headers_sent()) {
            foreach ($this->_headers as $header) {
                header($header, true);
            }
        }
        echo json_encode($data);
    }
1308550
public function sendData($data)
    {
        $data['order_string'] = http_build_query($data);

        return $this->response = new AopTradeAppPayResponse($this, $data);
    }
675232
public function write($data = null)
    {
        $this->response = $this->httpClient->post($this->parameters['url'], $this->getRequestParameters($data));
    }
353127
private function handleReceive($data)
    {
        if (!$this->isConnected && !$this->isConnecting) {
            return;
        }

        $flowCount = count($this->receivingFlows);

        $packets = $this->parser->push($data);
        foreach ($packets as $packet) {
            $this->handlePacket($packet);
        }

        if ($flowCount > count($this->receivingFlows)) {
            $this->receivingFlows = array_values($this->receivingFlows);
        }

        $this->handleSend();
    }
583108
private function send($data)
	{
		$rawMessage = json_encode($data);
		$payload = new WebsocketPayload;
		$payload->setOpcode(WebsocketPayload::OPCODE_TEXT)
				->setMask(TRUE)
				->setPayload($rawMessage);
		$encoded = $payload->encodePayload();
		fwrite($this->fd, $encoded);

		return $this;
	}
778191
public function receiveData(string $data): void
    {
        $chunkSize = null;

        while ($data) {
            $frame = $this->getReceivingFrame();

            $remaining = $frame->getRemainingData();

            if ($remaining === null) {
                $chunkSize = 2;
            } elseif ($remaining > 0) {
                $chunkSize = $remaining;
            }

            $chunkSize = min(strlen($data), $chunkSize);
            $chunk = substr($data, 0, $chunkSize);
            $data = substr($data, $chunkSize);

            $frame->receiveData($chunk);
        }
    }
994340
public function sendData($data)
    {
        $httpResponse = $this->sendRequest(
            'get',
            '/orders/' . $data['transactionId']
        );

        $this->response = new RestCompletePurchaseResponse(
            $this,
            json_decode($httpResponse->getBody()->getContents(), true)
        );

        return $this->response;
    }
401784
public function sendData($data)
    {
        $data = parent::sendData($data);

        return $this->response = new AopTradeRefundQueryResponse($this, $data);
    }
1135805
private function sendCreateRequest($data) {
		switch($this->getMayor()) {
			case 1:
				return $this->getSoapClient()->CreateShipmentDD($data);
			case 2:
			default:
				return $this->getSoapClient()->createShipmentOrder($data);
		}
	}
1221444
public function sendData($data)
    {
        $url = $this->getEndpoint();

        $body = [
            'form_params' => $data,
        ];

        if ($this->getTestMode()) {
            $body = [
                'verify' => false,
            ];
        }

        $response = $this->httpClient->post($url, [], $body);

        $contents = (string) $response->getBody();
        $xml = simplexml_load_string($contents);

        return $this->createResponse($xml);
    }