Skip to content

Commit 5003b4d

Browse files
author
Albert Leitato
committed
Fix Bug 🐛 invalid paraneter passed to response callback
1 parent 96a03e5 commit 5003b4d

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/Drivers/EmalifySMS.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ public function __construct(Client $gateway)
3535
/**
3636
* Send sms message.
3737
*
38-
* @param OutgoingMessage $message Elimuswift\SMS\OutgoingMessage
39-
**@param \Closure|null $callback
38+
* @param OutgoingMessage $message \Elimuswift\SMS\OutgoingMessage
39+
*
4040
* @return Response Guzzle PSR response
4141
*/
42-
public function send(OutgoingMessage $message, \Closure $callback = null)
42+
public function send(OutgoingMessage $message)
4343
{
4444
$options = [
4545
'from' => $message->getFrom(),

src/SMS.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class SMS
1111
/**
1212
* The Driver Interface instance.
1313
*
14-
* @var \Elimuswift\SMS\Drivers\DriverInterface
14+
* @var Drivers\DriverInterface
1515
*/
1616
protected $driver;
1717

@@ -58,9 +58,10 @@ public function driver($driver)
5858
*
5959
* @param string $view the desired view
6060
* @param array $data the data that needs to be passed into the view
61-
* @param \Closure $callback the methods that you wish to fun on the message
61+
* @param Closure $callback the methods that you wish to fun on the message
62+
* @param Closure|null $responseCallback
6263
*
63-
* @return \Elimuswift\SMS\OutgoingMessage the outgoing message that was sent
64+
* @return OutgoingMessage the outgoing message that was sent
6465
*/
6566
public function send($view, $data, $callback, Closure $responseCallback = null)
6667
{
@@ -71,9 +72,9 @@ public function send($view, $data, $callback, Closure $responseCallback = null)
7172
$message->data($data);
7273

7374
call_user_func($callback, $message);
74-
$response = $this->driver->send($message, $responseCallback);
75+
$response = $this->driver->send($message);
7576

76-
return $this->runCallbacks($response, $callback);
77+
return $this->runCallbacks($response, $responseCallback);
7778
}
7879

7980
/**
@@ -94,7 +95,7 @@ protected function runCallbacks($payload, $callback)
9495
/**
9596
* Creates a new Message instance.
9697
*
97-
* @return \Elimuswift\SMS\OutgoingMessage
98+
* @return OutgoingMessage
9899
*/
99100
protected function createOutgoingMessage()
100101
{
@@ -168,7 +169,7 @@ public function getMessage($messageId)
168169
/**
169170
* Get the current diver .
170171
*
171-
* @return \Elimuswift\SMS\Contracts\DriverInterface
172+
* @return DriverInterface
172173
*/
173174
public function getDriver()
174175
{

0 commit comments

Comments
 (0)