Skip to content

Commit 06b1c2f

Browse files
authored
Merge pull request #63 from SimpleSoftwareIO/analysis-q13Wv3
Apply fixes from StyleCI
2 parents c4909b5 + 51c57f6 commit 06b1c2f

12 files changed

Lines changed: 32 additions & 44 deletions

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: 0 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

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

src/MakesRequests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ trait MakesRequests
3232
*/
3333
protected function buildCall($url)
3434
{
35-
if (!$this->callBuilt) {
35+
if (! $this->callBuilt) {
3636
$this->apiBase .= $url;
3737
$this->callBuilt = true;
3838
}

src/SMS.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
namespace SimpleSoftwareIO\SMS;
44

55
use Closure;
6-
use Illuminate\Container\Container;
7-
use Illuminate\Queue\QueueManager;
86
use Illuminate\Support\Str;
9-
use SimpleSoftwareIO\SMS\Drivers\DriverInterface;
107
use SuperClosure\Serializer;
8+
use Illuminate\Queue\QueueManager;
9+
use Illuminate\Container\Container;
10+
use SimpleSoftwareIO\SMS\Drivers\DriverInterface;
1111

1212
class SMS
1313
{
@@ -191,7 +191,7 @@ public function laterOn($queue, $delay, $view, $data, $callback)
191191
*/
192192
protected function buildQueueCallable($callback)
193193
{
194-
if (!$callback instanceof Closure) {
194+
if (! $callback instanceof Closure) {
195195
return $callback;
196196
}
197197

0 commit comments

Comments
 (0)