escapePhoneNumber example

return $message instanceof SmsMessage;
    }

    protected function doSend(MessageInterface $message): SentMessage
    {
        if (!$message instanceof SmsMessage) {
            throw new UnsupportedMessageTypeException(__CLASS__, SmsMessage::class$message);
        }

        $data = [
            'login' => $this->login,
            'phone' => $phone = $this->escapePhoneNumber($message->getPhone()),
            'sender' => $message->getFrom() ?: $this->from,
            'text' => $message->getSubject(),
            'timestamp' => time(),
        ];
        $data['signature'] = $this->generateSignature($data);

        $endpoint = sprintf('https://%s/external/get/send.php', $this->getEndpoint());
        $response = $this->client->request('GET', $endpoint[
            'query' => $data,
        ]);

        
Home | Imprint | This part of the site doesn't use cookies.