Skip to content

Commit 93e7feb

Browse files
authored
Merge pull request #62 from SimpleSoftwareIO/develop
3.1.1
2 parents 1879b8a + 06b1c2f commit 93e7feb

14 files changed

Lines changed: 58 additions & 56 deletions

CHANGELOG.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,20 @@ Simple SMS
33

44
##Change Log
55

6-
####3.0.1
6+
#### 3.1.1
7+
* Laravel 5.4 Fix
8+
* Added US Cellular
9+
10+
#### 3.1.0
11+
* Added Just Send Driver and Bug Fixes
12+
13+
#### 3.0.1
714
* Fixed a bug where the config file was not being copied correctly.
815

9-
####3.0.0
16+
#### 3.0.0
1017
* Updated Readme
1118

12-
####3.0.0-Beta1
19+
#### 3.0.0-Beta1
1320
* Added FlowRoute Driver. --Thanks [rasumo](https://github.com/rasumo)
1421
* Added Plivo Driver. --Thanks [rasumo](https://github.com/rasumo)
1522
* Config file now users env by default. --Thanks [rasumo](https://github.com/rasumo)
@@ -22,24 +29,24 @@ Simple SMS
2229
* Moved to PSR-4 Autoloading.
2330
* PSR-2 Cleanup.
2431

25-
####2.1.2
32+
#### 2.1.2
2633
* An `outgoing message` is now returned when a message is sent. --Thanks [marfurt](https://github.com/marfurt)
2734
* The E-Mail driver only sends emails in text format now. --Thanks [cozylife](https://github.com/cozylife)
2835
* Added a new Zenvia Driver. --Thanks [filipegar](https://github.com/filipegar)
2936
* Updated docs to point to simplesoftware.io
3037

31-
####2.1.1
38+
#### 2.1.1
3239
* Updated Twilio dependency.
3340

34-
####2.1.0
41+
#### 2.1.0
3542
* Fixed doc blocks --Thanks [Ellrion](https://github.com/Ellrion)
3643
* Created Driver Manager class to better manager drivers. --Thanks [Ellrion](https://github.com/Ellrion)
3744
* Added LabsMobile driver --Thanks [borislalov](https://github.com/borislalov)
3845
* Added Nexmo driver --Thanks [cricu](https://github.com/cricu)
3946
* Added ability to switch drivers at runtime.
4047
* Fixed a bug when the `queue` method is called upon.
4148

42-
####2.0.0
49+
#### 2.0.0
4350
* Full Laravel 5.X support.
4451
* Updated to Guzzle 6.
4552
* Dropped support for PHP 5.4
@@ -49,22 +56,22 @@ Simple SMS
4956
####2.0.0-Beta1
5057
* Adds support for Laravel 5
5158

52-
####1.1.0
59+
#### 1.1.0
5360
* Added MMS support for Twilio.
5461
* Corrected some typos in the readme.
5562

56-
####1.0.0
63+
#### 1.0.0
5764
* Removed unstable development warnings.
5865
* Basic doc cleanup.
5966

60-
####Beta 1
67+
#### Beta 1
6168
* Dropping receive support for CallFire due to not being able to get a keyword to test.
6269
* Dropping support for Mozeo receive due to not being able to get an API link forwarding set up automatically.
6370

64-
####Alpha 3
71+
#### Alpha 3
6572
* General comment and code clean up.
6673

67-
####Alpha 2
74+
#### Alpha 2
6875
* Expanded documentation.
6976
* EZTexting now supports checking for messages.
7077
* CallFire now supports checking for messages.

docs/en/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ The following are currently supported by using the e-mail gateway driver.
125125
| USA | Virgin Mobile | virginmobile | Yes | Yes |
126126
| USA | T-Mobile | tmobile | Yes | Yes |
127127
| USA | Sprint | sprint | Yes | Yes |
128+
| USA | US Cellular | uscellular | Yes | Yes |
128129

129130
>You must know the wireless provider for the mobile phone to use this driver.
130131
@@ -284,7 +285,7 @@ This driver sends messages through the [JustSend](https://justsend.pl/) messagin
284285
'api_key' => 'Your API Key.'
285286
]
286287
];
287-
288+
288289
`from` can be one of the following:
289290
- `ECO` - cheapest type (about 0.03 PLN per SMS). SMS will be send from random short-code number.
290291
- One of: `INFO`, `INFORMACJA`, `KONKURS`, `NOWOSC`, `OFERTA`, `OKAZJA`, `PROMOCJA`, `SMS` - about 0.06 PLN per SMS.

src/DriverManager.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44

55
use GuzzleHttp\Client;
66
use Illuminate\Support\Manager;
7-
use SimpleSoftwareIO\SMS\Drivers\CallFireSMS;
8-
use SimpleSoftwareIO\SMS\Drivers\EmailSMS;
9-
use SimpleSoftwareIO\SMS\Drivers\EZTextingSMS;
10-
use SimpleSoftwareIO\SMS\Drivers\FlowrouteSMS;
11-
use SimpleSoftwareIO\SMS\Drivers\JustSendSMS;
12-
use SimpleSoftwareIO\SMS\Drivers\LabsMobileSMS;
7+
use SimpleSoftwareIO\SMS\Drivers\SMS77;
138
use SimpleSoftwareIO\SMS\Drivers\LogSMS;
9+
use SimpleSoftwareIO\SMS\Drivers\EmailSMS;
1410
use SimpleSoftwareIO\SMS\Drivers\MozeoSMS;
1511
use SimpleSoftwareIO\SMS\Drivers\NexmoSMS;
1612
use SimpleSoftwareIO\SMS\Drivers\PlivoSMS;
17-
use SimpleSoftwareIO\SMS\Drivers\SMS77;
1813
use SimpleSoftwareIO\SMS\Drivers\TwilioSMS;
1914
use SimpleSoftwareIO\SMS\Drivers\ZenviaSMS;
15+
use SimpleSoftwareIO\SMS\Drivers\CallFireSMS;
16+
use SimpleSoftwareIO\SMS\Drivers\JustSendSMS;
17+
use SimpleSoftwareIO\SMS\Drivers\EZTextingSMS;
18+
use SimpleSoftwareIO\SMS\Drivers\FlowrouteSMS;
19+
use SimpleSoftwareIO\SMS\Drivers\LabsMobileSMS;
2020

2121
class DriverManager extends Manager
2222
{

src/Drivers/AbstractSMS.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
abstract class AbstractSMS
99
{
10-
1110
protected $debug;
1211

1312
/**
@@ -72,14 +71,12 @@ protected function makeMessage($rawMessage)
7271
abstract protected function processReceive($rawMessage);
7372

7473
/**
75-
* Defines if debug is enabled or disabled (SMS77)
74+
* Defines if debug is enabled or disabled (SMS77).
7675
*
7776
* @param $debug
7877
*/
7978
public function setDebug($debug)
8079
{
8180
$this->debug = $debug;
8281
}
83-
84-
8582
}

src/Drivers/EmailSMS.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,11 @@ protected function lookupGateway($carrier, $mms)
116116

117117
case 'airfiremobile':
118118
throw new \InvalidArgumentException('Air Fire Mobile does not support Email Gateway MMS messages.');
119-
120119
case 'alaskacommunicates':
121120
return 'msg.acsalaska.com';
122121

123122
case 'ameritech':
124123
throw new \InvalidArgumentException('Ameritech does not support Email Gateway MMS messages.');
125-
126124
case 'assurancewireless':
127125
return 'vmobl.com';
128126

@@ -131,7 +129,6 @@ protected function lookupGateway($carrier, $mms)
131129

132130
case 'cleartalk':
133131
throw new \InvalidArgumentException('Clear Talk does not support Email Gateway MMS messages.');
134-
135132
case 'cricket':
136133
return 'mms.mycricket.com ';
137134

@@ -140,7 +137,6 @@ protected function lookupGateway($carrier, $mms)
140137

141138
case 'nextech':
142139
throw new \InvalidArgumentException('NexTech does not support Email Gateway MMS messages.');
143-
144140
case 'projectfi':
145141
return 'msg.fi.google.com';
146142

@@ -162,6 +158,9 @@ protected function lookupGateway($carrier, $mms)
162158
case 'sprint':
163159
return 'pm.sprint.com';
164160

161+
case 'uscellular':
162+
return 'mms.uscc.net';
163+
165164
default:
166165
throw new \InvalidArgumentException('Carrier specified is not found.');
167166
}
@@ -218,6 +217,9 @@ protected function lookupGateway($carrier, $mms)
218217
case 'sprint':
219218
return 'messaging.sprintpcs.com';
220219

220+
case 'uscellular':
221+
return 'email.uscc.net';
222+
221223
default:
222224
throw new \InvalidArgumentException('Carrier specified is not found.');
223225
}

src/Drivers/LabsMobileSMS.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace SimpleSoftwareIO\SMS\Drivers;
44

55
use GuzzleHttp\Client;
6-
use SimpleSoftwareIO\SMS\DoesNotReceive;
76
use SimpleSoftwareIO\SMS\MakesRequests;
7+
use SimpleSoftwareIO\SMS\DoesNotReceive;
88
use SimpleSoftwareIO\SMS\OutgoingMessage;
99

1010
class LabsMobileSMS extends AbstractSMS implements DriverInterface

src/Drivers/MozeoSMS.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace SimpleSoftwareIO\SMS\Drivers;
44

55
use GuzzleHttp\Client;
6-
use SimpleSoftwareIO\SMS\DoesNotReceive;
76
use SimpleSoftwareIO\SMS\MakesRequests;
7+
use SimpleSoftwareIO\SMS\DoesNotReceive;
88
use SimpleSoftwareIO\SMS\OutgoingMessage;
99

1010
class MozeoSMS extends AbstractSMS implements DriverInterface

src/Drivers/PlivoSMS.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ protected function validateRequest()
148148
$signature = $_SERVER['X-Plivo-Signature'];
149149
$authToken = $this->authToken;
150150

151-
if (!$this->plivo->validate_signature($url, $data, $signature, $authToken)) {
151+
if (! $this->plivo->validate_signature($url, $data, $signature, $authToken)) {
152152
throw new \InvalidArgumentException('This request was not able to verify it came from Plivo.');
153153
}
154154

src/Drivers/SMS77.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?php
2+
23
namespace SimpleSoftwareIO\SMS\Drivers;
34

45
use GuzzleHttp\Client;
5-
use SimpleSoftwareIO\SMS\DoesNotReceive;
66
use SimpleSoftwareIO\SMS\MakesRequests;
7+
use SimpleSoftwareIO\SMS\DoesNotReceive;
78
use SimpleSoftwareIO\SMS\OutgoingMessage;
89

910
class SMS77 extends AbstractSMS implements DriverInterface
@@ -67,11 +68,12 @@ public function send(OutgoingMessage $message)
6768
if ($this->hasError($responseBody)) {
6869
$this->handleError($responseBody);
6970
}
71+
7072
return $response;
7173
}
7274

7375
/**
74-
* Checks if the transaction has an error
76+
* Checks if the transaction has an error.
7577
*
7678
* @param $body
7779
* @return bool
@@ -81,20 +83,21 @@ protected function hasError($body)
8183
if ($body != '100') {
8284
return $body;
8385
}
86+
8487
return false;
8588
}
8689

8790
/**
88-
* Log the error message which ocurred
91+
* Log the error message which ocurred.
8992
*
9093
* @param $body
9194
*/
9295
protected function handleError($body)
9396
{
94-
$error = 'An error occurred. Status code: ' . $body . ' - ';
97+
$error = 'An error occurred. Status code: '.$body.' - ';
9598

9699
//From https://www.sms77.de/api.pdf Rückgabewerte (German doc)
97-
switch($body){
100+
switch ($body) {
98101
case '101':
99102
$error .= 'Versand an mindestens einen Empfänger fehlgeschlagen';
100103
break;

src/Drivers/ZenviaSMS.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
class ZenviaSMS extends AbstractSMS implements DriverInterface
1010
{
1111
use MakesRequests;
12-
12+
1313
/**
1414
* The API's URL.
1515
*
@@ -119,7 +119,7 @@ public function checkMessages(array $options = [])
119119

120120
$jsonResponse = json_decode($this->postRequest()->getBody()->getContents());
121121

122-
if (!isset($jsonResponse->receivedResponse)) {
122+
if (! isset($jsonResponse->receivedResponse)) {
123123
throw new \Exception('Invalid response from API. Missing mandatory object.');
124124
}
125125

@@ -244,7 +244,7 @@ private function generateMessageBody($from, $number, $composeMessage)
244244
'callbackOption' => $this->callbackOption,
245245
];
246246

247-
if (!is_null($number['carrier'])) {
247+
if (! is_null($number['carrier'])) {
248248
$aux['id'] = $number['carrier'];
249249
}
250250

0 commit comments

Comments
 (0)