@@ -149,8 +149,8 @@ discard block |
||
| 149 | 149 | { |
| 150 | 150 | $options = $request->options(); |
| 151 | 151 | |
| 152 | - if (! isset($options['headers']["Authorization"])) { |
|
| 153 | - $options['headers']["Authorization"] = "Bearer ". $this->getToken(); |
|
| 152 | + if (!isset($options['headers']["Authorization"])) { |
|
| 153 | + $options['headers']["Authorization"] = "Bearer ".$this->getToken(); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | $response = $request->execute($options)->getBody(); |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | */ |
| 180 | 180 | public static function getInstance() |
| 181 | 181 | { |
| 182 | - if (! static::$instance) { |
|
| 182 | + if (!static::$instance) { |
|
| 183 | 183 | static::$instance = new static(); |
| 184 | 184 | } |
| 185 | 185 | |
@@ -109,7 +109,7 @@ |
||
| 109 | 109 | $phone = (string) $phone; |
| 110 | 110 | |
| 111 | 111 | if (substr($phone, 0, 1) !== '+') { |
| 112 | - return '+' . $phone; |
|
| 112 | + return '+'.$phone; |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | return $phone; |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | { |
| 28 | 28 | $this->enforceHttpSecureProtocol($callbackUri); |
| 29 | 29 | |
| 30 | - if (! $senderAddress) { |
|
| 30 | + if (!$senderAddress) { |
|
| 31 | 31 | throw new Exception('Missing sender address'); |
| 32 | 32 | } |
| 33 | 33 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | public function __construct($id) |
| 21 | 21 | { |
| 22 | - if (! $id) { |
|
| 22 | + if (!$id) { |
|
| 23 | 23 | throw new Exception('Missing subscription id'); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -36,10 +36,10 @@ |
||
| 36 | 36 | $this->sender = 'tel:'.$this->normalizePhoneNumber($senderNumber); |
| 37 | 37 | |
| 38 | 38 | $this->body = ['outboundSMSMessageRequest' => [ |
| 39 | - 'address' => 'tel:'.$this->normalizePhoneNumber($recipientNumber), |
|
| 40 | - 'senderAddress' => 'tel:'.$this->normalizePhoneNumber($senderNumber), |
|
| 41 | - 'outboundSMSTextMessage' => [ 'message' => $message ?: ''] |
|
| 42 | - ] |
|
| 39 | + 'address' => 'tel:'.$this->normalizePhoneNumber($recipientNumber), |
|
| 40 | + 'senderAddress' => 'tel:'.$this->normalizePhoneNumber($senderNumber), |
|
| 41 | + 'outboundSMSTextMessage' => [ 'message' => $message ?: ''] |
|
| 42 | + ] |
|
| 43 | 43 | ]; |
| 44 | 44 | |
| 45 | 45 | if ($senderName) { |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | $this->body = ['outboundSMSMessageRequest' => [ |
| 39 | 39 | 'address' => 'tel:'.$this->normalizePhoneNumber($recipientNumber), |
| 40 | 40 | 'senderAddress' => 'tel:'.$this->normalizePhoneNumber($senderNumber), |
| 41 | - 'outboundSMSTextMessage' => [ 'message' => $message ?: ''] |
|
| 41 | + 'outboundSMSTextMessage' => ['message' => $message ?: ''] |
|
| 42 | 42 | ] |
| 43 | 43 | ]; |
| 44 | 44 | |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | { |
| 57 | 57 | return [ |
| 58 | 58 | 'headers' => [ |
| 59 | - 'Authorization' => "Basic " . base64_encode("{$this->clientID}:{$this->clientSecret}") |
|
| 59 | + 'Authorization' => "Basic ".base64_encode("{$this->clientID}:{$this->clientSecret}") |
|
| 60 | 60 | ], |
| 61 | 61 | 'form_params' => [ |
| 62 | 62 | 'grant_type' => 'client_credentials' |
@@ -25,11 +25,11 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | public function __construct($id, $sender) |
| 27 | 27 | { |
| 28 | - if (! $sender) { |
|
| 28 | + if (!$sender) { |
|
| 29 | 29 | throw new Exception('Missing sender address'); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - if (! $id) { |
|
| 32 | + if (!$id) { |
|
| 33 | 33 | throw new Exception('Missing subscription id'); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | */ |
| 41 | 41 | public function uri() |
| 42 | 42 | { |
| 43 | - $uri = static::BASE_URI . '/sms/admin/v1/contracts'; |
|
| 43 | + $uri = static::BASE_URI.'/sms/admin/v1/contracts'; |
|
| 44 | 44 | |
| 45 | 45 | return $this->countryCode ? $uri.'?country='.$this->countryCode : $uri; |
| 46 | 46 | } |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | { |
| 53 | 53 | $filters = $this->queryFilters(); |
| 54 | 54 | |
| 55 | - $uri = static::BASE_URI . '/sms/admin/v1/statistics'; |
|
| 55 | + $uri = static::BASE_URI.'/sms/admin/v1/statistics'; |
|
| 56 | 56 | |
| 57 | 57 | return count($filters) ? $uri.'?'.http_build_query($filters) : $uri; |
| 58 | 58 | } |