From 2f4c6f0d574ecc228845ea72fdefd495c88cc4b2 Mon Sep 17 00:00:00 2001 From: Vignesh Gurusamy Date: Fri, 30 Mar 2018 12:14:27 +0530 Subject: [PATCH] Support for laravel 5.6 --- composer.json | 6 +++--- src/SmsManager.php | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 71855df..7d3c5bc 100644 --- a/composer.json +++ b/composer.json @@ -20,8 +20,8 @@ } ], "require": { - "php": ">=7.0.0", - "illuminate/support": "5.3.*|5.4.*|5.5.*", + "php": ">=7.1.3", + "illuminate/support": "5.3.*|5.4.*|5.5.*|5.6.*", "guzzlehttp/guzzle": "~6.0" }, "autoload": { @@ -31,7 +31,7 @@ }, "require-dev": { "orchestra/testbench": "~3.5", - "phpunit/phpunit": "~6.0" + "phpunit/phpunit": "~6.0|~7.0" }, "autoload-dev": { "psr-4": { diff --git a/src/SmsManager.php b/src/SmsManager.php index 6b31a58..4f6e3e7 100644 --- a/src/SmsManager.php +++ b/src/SmsManager.php @@ -128,10 +128,9 @@ public function dispatch(): ResponseInterface */ public function send(Device $device, string $message): ResponseInterface { - $this->device = $device; - $this->message = $message; - - return $this->dispatch(); + return $this->to($device) + ->message($message) + ->dispatch(); } /** @@ -165,7 +164,9 @@ public function resolveConnection(Device $device): string } } - return $connection ?: AdapterException::noPossibleConnection($device); + return isset($connection) + ? $connection + : AdapterException::noPossibleConnection($device); } /**