Prepares the data to be sent.
@param string  $data
@return \Ratchet\RFC6455\Messaging\Message
493231
function prepareMessage(string $data): \Ratchet\RFC6455\Messaging\Message {
        $frame = new \Ratchet\RFC6455\Messaging\Frame($data, true, \Ratchet\RFC6455\Messaging\Frame::OP_BINARY);
        
        $msg = new \Ratchet\RFC6455\Messaging\Message();
        $msg->addFrame($frame);
        
        return $msg;
    }
1219144
public function sendData($data)
    {
        $response = $this->gocardless->customers()->create($data);

        return $this->response = new CustomerResponse($this, $response);
    }
380847
private function prepare($data)
    {
        foreach ($data as $code => &$item) {
            $item = $this->prepareItem($code, $item);
        }
        return $data;
    }
606248
public function sendData($data)
    {
        $response = $this->gocardless->mandates()->reinstate($this->getMandateReference());

        return $this->response = new MandateResponse($this, $response);
    }
1151784
protected function send($data)
    {
        $this->debug("Send: $data");

        $result = $this->socket->write($data);
        if (!$result || PEAR::isError($result)) {
            $msg = $result ? $result->getMessage() : "unknown error";
            return PEAR::raiseError("Failed to write to socket: $msg");
        }

        return $result;
    }
996277
public function sendData($data)
    {
        $httpResponse = $this->httpClient->post($this->getEndpoint(), null, $data)->send();

        return $this->response = new Response($this, $httpResponse->getBody());
    }
651735
public function sendData($data)
    {
        $endpoint = $this->getEndpoint();
        $headers = array(
            'Content-Type' => 'text/xml; charset=utf-8',
            'SOAPAction' => $endpoint.'/'.$this->getMethod(),
        );

        $httpResponse = $this->httpClient->post($endpoint, $headers, $data)->send();

        return $this->createResponse($httpResponse->xml());
    }
487834
protected function encodeMessage($data)
    {
        return $this->server->getBean(\Imi\Server\DataParser\DataParser::class)->encode($data);
    }
273730
protected function prepareData(array $data)
	{
		$data = array_merge(array(
			'name'       => null,
			'email'      => null,
			'username'   => null,
			'id'         => null,
			'text'       => null,
			'ip'         => null,
			'user_agent' => null
		), $data);

		$data['original_text'] = $data['text'];

		if ($this->stringProcessor)
		{
			$data['text'] = $this->stringProcessor->prepare($data['text']);
		}

		return $data;
	}
1337727
public function sendData($data)
    {
        if ($this->sendData === null) {
            $this->sendData = $this->getData();
        }

        $data = $this->createSOAPEnvelope(
            $this->prepareParameters(
                $this->sendData
            )
        );

        $headers = array(
            'Content-Type' => 'text/xml; charset=utf-8',
            'SOAPAction' => $this->method
        );

        $httpResponse = $this->httpClient->post(
            $this->getEndpoint(),
            $headers,
            $data
        )->send();

        return $this->response = new Response($this, $httpResponse->getBody());
    }
456153
public function sendData($data)
    {
        $data = parent::sendData($data);

        return $this->response = new AopTradeCreateResponse($this, $data);
    }
1328800
public function setContentData(string $data): self
    {
        $this->contentData = $data;
        $this->contentLength = strlen($this->contentData);
        $extraLength = $this->contentLength % 8;
        $this->paddingLength = $extraLength ? (8 - $extraLength) : 0;
        return $this;
    }
971075
public function write($data)
    {
        $this->contentLength += strlen($data);
        $this->data .= $data;

        return $this;
    }
219317
public function sendMassMessage($data)
    {
        return $this->auth(function () use ($data) {
            if (!is_string($data)) {
                $data = json_encode($data, JSON_UNESCAPED_UNICODE);
            }

            return $this->http->postJson(
                $this->baseUrl . 'cgi-bin/message/mass/send?access_token=' . $this->accessToken,
                $data
            );
        });
    }
555240
public function send($data)
    {
        $pieces = [
          $this->config['apiKey'],
          $this->config['prefix'],
          $data.' '.time(),
        ];
        $message = implode('.', $pieces).PHP_EOL;

        return $this->sendData($this->config['host'], $this->config['port'], $message);
    }
243845
private function rewrite($data)
    {
        $text = json_encode($data);
        if ($this->isEncrypted() && strlen($text) > 0) {
            $text = Crypto::encryptWithPassword($text, $this->key, true);
        }
        file_put_contents($this->file, $text);
        return $data;
    }
1097427
public function make($data)
	{
		$payload = array_merge($this->payload, $data);
		return $this->auth->make($payload, $this->secretKey);
	}