@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function hasRecipients() |
114 | 114 | { |
115 | - return ! empty($this->recipients); |
|
115 | + return !empty($this->recipients); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function addRecipientVariable($recipient, $recipientVariable, $recipientVariableValue) |
147 | 147 | { |
148 | - if (! isset($this->recipientVariables[$recipient])) { |
|
148 | + if (!isset($this->recipientVariables[$recipient])) { |
|
149 | 149 | $this->recipientVariables[$recipient] = []; |
150 | 150 | } |
151 | 151 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | */ |
173 | 173 | public function hasRecipientVariables() |
174 | 174 | { |
175 | - return ! empty($this->recipientVariables); |
|
175 | + return !empty($this->recipientVariables); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | */ |
243 | 243 | public function setDeliveryStart(\DateTime $deliveryStart = null) |
244 | 244 | { |
245 | - if (null !== $deliveryStart && $deliveryStart < date_create_from_format('U', (string)time())) { |
|
245 | + if (null !== $deliveryStart && $deliveryStart < date_create_from_format('U', (string) time())) { |
|
246 | 246 | throw new InvalidDeliveryStartException(); |
247 | 247 | } |
248 | 248 |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function send(Sms $sms) |
59 | 59 | { |
60 | - if (! $sms->hasRecipients()) { |
|
60 | + if (!$sms->hasRecipients()) { |
|
61 | 61 | throw new NoRecipientsSpecifiedException(); |
62 | 62 | } |
63 | 63 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | ; |
73 | 73 | |
74 | 74 | foreach ($chunk as $recipient) { |
75 | - if (! isset($sms->getRecipientVariables()[$recipient])) { |
|
75 | + if (!isset($sms->getRecipientVariables()[$recipient])) { |
|
76 | 76 | continue; |
77 | 77 | } |
78 | 78 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | SendMethods::TEST_CLASSIC_PLUS, |
137 | 137 | SendMethods::TEST_BASIC, |
138 | 138 | ]) |
139 | - ->setAllowedValues('validity_period', function (\DateInterval $value) { |
|
139 | + ->setAllowedValues('validity_period', function(\DateInterval $value) { |
|
140 | 140 | return $value->i >= ValidityPeriods::MIN && $value->i <= ValidityPeriods::MAX; |
141 | 141 | }) |
142 | 142 | ->setAllowedValues('encoding_schema', [ |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | { |
195 | 195 | $recipients = $sms->getRecipients(); |
196 | 196 | |
197 | - if (! $sms->hasRecipientVariables()) { |
|
197 | + if (!$sms->hasRecipientVariables()) { |
|
198 | 198 | $recipients = array_map([$this, 'normalizePhoneNumber'], $recipients); |
199 | 199 | |
200 | 200 | return json_encode($recipients); |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | |
203 | 203 | $recipientVariables = $sms->getRecipientVariables(); |
204 | 204 | |
205 | - return json_encode(array_map(function ($recipient) use ($recipientVariables) { |
|
205 | + return json_encode(array_map(function($recipient) use ($recipientVariables) { |
|
206 | 206 | $targetVariables = []; |
207 | 207 | if (isset($recipientVariables[$recipient])) { |
208 | 208 | $targetVariables = $recipientVariables[$recipient]; |
@@ -26,8 +26,8 @@ |
||
26 | 26 | |
27 | 27 | public function __toString() |
28 | 28 | { |
29 | - return '[' . get_class($this) . '] ' . $this->message . "\n" . |
|
30 | - 'Response: ' . "\n" . |
|
29 | + return '['.get_class($this).'] '.$this->message."\n". |
|
30 | + 'Response: '."\n". |
|
31 | 31 | $this->response |
32 | 32 | ; |
33 | 33 | } |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace Fazland\SkebbyRestClient\Exception; |
4 | 4 | |
@@ -21,15 +21,15 @@ discard block |
||
21 | 21 | |
22 | 22 | public function __toString() |
23 | 23 | { |
24 | - return '[' . get_class($this) . '] ' . $this->message . "\n" . |
|
25 | - 'Response: ' . "\n" . |
|
24 | + return '['.get_class($this).'] '.$this->message."\n". |
|
25 | + 'Response: '."\n". |
|
26 | 26 | $this->response |
27 | 27 | ; |
28 | 28 | } |
29 | 29 | |
30 | 30 | private function decodeXmlError(\LibXMLError $error, $xml) |
31 | 31 | { |
32 | - $return = $xml[$error->line - 1] . "\n"; |
|
32 | + $return = $xml[$error->line - 1]."\n"; |
|
33 | 33 | |
34 | 34 | switch ($error->level) { |
35 | 35 | case LIBXML_ERR_WARNING: |
@@ -45,14 +45,14 @@ discard block |
||
45 | 45 | break; |
46 | 46 | } |
47 | 47 | |
48 | - $return .= trim($error->message) . |
|
49 | - "\n Line: $error->line" . |
|
48 | + $return .= trim($error->message). |
|
49 | + "\n Line: $error->line". |
|
50 | 50 | "\n Column: $error->column"; |
51 | 51 | |
52 | 52 | if ($error->file) { |
53 | 53 | $return .= "\n File: $error->file"; |
54 | 54 | } |
55 | 55 | |
56 | - return $return . "\n\n"; |
|
56 | + return $return."\n\n"; |
|
57 | 57 | } |
58 | 58 | } |
@@ -60,22 +60,22 @@ |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | foreach (SendMethods::all() as $method) { |
63 | - if (! isset($doc->$method)) { |
|
63 | + if (!isset($doc->$method)) { |
|
64 | 64 | continue; |
65 | 65 | } |
66 | 66 | |
67 | 67 | $element = $doc->$method; |
68 | 68 | |
69 | - if (! isset($element->status)) { |
|
69 | + if (!isset($element->status)) { |
|
70 | 70 | throw new UnknownErrorResponseException('Missing response status value from Skebby', $rawResponse); |
71 | 71 | } |
72 | 72 | |
73 | - $this->status = (string)$element->status; |
|
74 | - $this->messageId = isset($element->id) ? (string)$element->id : null; |
|
73 | + $this->status = (string) $element->status; |
|
74 | + $this->messageId = isset($element->id) ? (string) $element->id : null; |
|
75 | 75 | |
76 | - if (! $this->isSuccessful()) { |
|
77 | - $this->code = isset($element->code) ? (string)$element->code : null; |
|
78 | - $this->errorMessage = isset($element->message) ? (string)$element->message : 'Unknown error'; |
|
76 | + if (!$this->isSuccessful()) { |
|
77 | + $this->code = isset($element->code) ? (string) $element->code : null; |
|
78 | + $this->errorMessage = isset($element->message) ? (string) $element->message : 'Unknown error'; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | return; |