Skip to content

Commit

Permalink
Bug fix in SendSMS class
Browse files Browse the repository at this point in the history
  • Loading branch information
orkhanshukurlu committed Aug 24, 2023
1 parent ea4d805 commit d118822
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/SendSMS.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
use OrkhanShukurlu\MSM\Models\MSMLog;
use Throwable;

use function parse_str;

final class SendSMS
{
/**
Expand Down Expand Up @@ -84,15 +86,15 @@ public function __construct()
/**
* Send SMS to phone number.
*
* @param int|string $phone
* @param string $phone
* @param int|string $message
*
* @throws SMSNotSentException
* @throws Throwable
*
* @return void
*/
public function send(int|string $phone, int|string $message): void
public function send(string $phone, int|string $message): void
{
$body = $this->setQueryParams($phone, $message)->sendRequest()->body();

Expand All @@ -104,12 +106,12 @@ public function send(int|string $phone, int|string $message): void
/**
* Log SMS to the database if logging is enabled.
*
* @param int|string $phone
* @param string $phone
* @param int|string $message
*
* @return void
*/
private function addLogIfEnabled(int|string $phone, int|string $message): void
private function addLogIfEnabled(string $phone, int|string $message): void
{
if ($this->logging !== true) {
return;
Expand Down Expand Up @@ -153,12 +155,12 @@ private function sendRequest(): Response
/**
* Set query parameters for request.
*
* @param int|string $phone
* @param string $phone
* @param int|string $message
*
* @return $this
*/
private function setQueryParams(int|string $phone, int|string $message): self
private function setQueryParams(string $phone, int|string $message): self
{
$this->query = [
'user' => $this->username,
Expand Down

0 comments on commit d118822

Please sign in to comment.