* HOST split into two parts

This commit is contained in:
Vasilij Dusko 2021-03-28 15:58:51 +03:00 committed by Vasilij Dusko | CREATION
parent 9e1809e6ae
commit 3cbbc85e43
2 changed files with 5 additions and 10 deletions

View File

@ -25,7 +25,7 @@ use Symfony\Contracts\HttpClient\HttpClientInterface;
*/ */
final class LightSmsTransport extends AbstractTransport final class LightSmsTransport extends AbstractTransport
{ {
protected const HOST = 'www.lightsms.com/external/get/send.php'; protected const HOST = 'www.lightsms.com';
private $login; private $login;
private $password; private $password;
@ -78,13 +78,8 @@ final class LightSmsTransport extends AbstractTransport
'39' => 'Phone number is not exist in this base', '39' => 'Phone number is not exist in this base',
]; ];
public function __construct( public function __construct(string $login, string $password, string $phone, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
string $login, {
string $password,
string $phone,
HttpClientInterface $client = null,
EventDispatcherInterface $dispatcher = null
) {
$this->login = $login; $this->login = $login;
$this->password = $password; $this->password = $password;
$this->phone = $phone; $this->phone = $phone;
@ -113,7 +108,7 @@ final class LightSmsTransport extends AbstractTransport
$signature = $this->generateSignature(); $signature = $this->generateSignature();
$endpoint = sprintf( $endpoint = sprintf(
'https://%s?login=%s&signature=%s&phone=%s&text=%s&sender=%s&timestamp=%s', 'https://%s/external/get/send.php?login=%s&signature=%s&phone=%s&text=%s&sender=%s&timestamp=%s',
$this->getEndpoint(), $this->getEndpoint(),
$this->login, $this->login,
$signature, $signature,

View File

@ -1,5 +1,5 @@
LightSms Notifier LightSms Notifier
==================== ===============
Provides [LightSms](https://www.lightsms.com/) integration for Symfony Notifier. Provides [LightSms](https://www.lightsms.com/) integration for Symfony Notifier.