@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | * @param array $customFieldsWithValues |
115 | 115 | * @return null |
116 | 116 | */ |
117 | - public function testCampaign(string $campaignHash, array $emailAddresses, array $customFieldsWithValues = []); |
|
117 | + public function testCampaign(string $campaignHash, array $emailAddresses, array $customFieldsWithValues = [ ]); |
|
118 | 118 | |
119 | 119 | /** |
120 | 120 | * Sends the campaign at given time. |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | string $listHash, |
169 | 169 | int $subscriberStatus = 0, |
170 | 170 | bool $sendConfirmationToSubscriber = false, |
171 | - array $customFieldsWithValues = [] |
|
171 | + array $customFieldsWithValues = [ ] |
|
172 | 172 | ); |
173 | 173 | |
174 | 174 | /** |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | string $email, |
185 | 185 | string $listHash, |
186 | 186 | int $subscriberStatus = 0, |
187 | - array $customFieldsWithValues = [] |
|
187 | + array $customFieldsWithValues = [ ] |
|
188 | 188 | ); |
189 | 189 | |
190 | 190 | /** |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | public function createSubscriberList( |
243 | 243 | string $listName, |
244 | 244 | string $description = '', |
245 | - array $customFieldsWithValues = [] |
|
245 | + array $customFieldsWithValues = [ ] |
|
246 | 246 | ): \stdClass; |
247 | 247 | |
248 | 248 | /** |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | * @param array $customFieldsWithValues |
207 | 207 | * @return null |
208 | 208 | */ |
209 | - public function testCampaign(string $campaignHash, array $emailAddresses, array $customFieldsWithValues = []) |
|
209 | + public function testCampaign(string $campaignHash, array $emailAddresses, array $customFieldsWithValues = [ ]) |
|
210 | 210 | { |
211 | 211 | $handler = new CampaignTestHandler(new ErrorHandler(), $this->apiKey, $this->apiSecret); |
212 | 212 | $handler->testCampaign( |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | string $listHash, |
290 | 290 | int $subscriberStatus = 0, |
291 | 291 | bool $sendConfirmationToSubscriber = false, |
292 | - array $customFieldsWithValues = [] |
|
292 | + array $customFieldsWithValues = [ ] |
|
293 | 293 | ) { |
294 | 294 | $handler = new SubscriberAddHandler(new ErrorHandler(), $this->apiKey, $this->apiSecret); |
295 | 295 | $handler->addSubscriber( |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | string $email, |
315 | 315 | string $listHash, |
316 | 316 | int $subscriberStatus = 0, |
317 | - array $customFieldsWithValues = [] |
|
317 | + array $customFieldsWithValues = [ ] |
|
318 | 318 | ) { |
319 | 319 | $handler = new SubscriberEditHandler(new ErrorHandler(), $this->apiKey, $this->apiSecret); |
320 | 320 | $handler->editSubscriber( |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | public function createSubscriberList( |
408 | 408 | string $listName, |
409 | 409 | string $description = '', |
410 | - array $customFieldsWithValues = [] |
|
410 | + array $customFieldsWithValues = [ ] |
|
411 | 411 | ): stdClass { |
412 | 412 | $handler = new ListCreateHandler(new ErrorHandler(), $this->apiKey, $this->apiSecret); |
413 | 413 | return $handler->createSubscriberList( |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | string $messageId = '', |
35 | 35 | bool $single = false |
36 | 36 | ) { |
37 | - $getParameters = []; |
|
37 | + $getParameters = [ ]; |
|
38 | 38 | $postParameters = [ |
39 | 39 | 'gsm' => $phoneNumber, |
40 | 40 | 'text' => $content, |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | 'messageId' => $messageId ?: null |
44 | 44 | ]; |
45 | 45 | |
46 | - $postParameters = array_filter($postParameters, function ($value) { |
|
46 | + $postParameters = array_filter($postParameters, function($value) { |
|
47 | 47 | return $value !== null; |
48 | 48 | }); |
49 | 49 | $this->processRequest($getParameters, $postParameters); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | bool $tracking = false, |
42 | 42 | string $domain = '' |
43 | 43 | ) { |
44 | - $getParameters = []; |
|
44 | + $getParameters = [ ]; |
|
45 | 45 | $postParameters = [ |
46 | 46 | 'subscriber' => $email, |
47 | 47 | 'subject' => $subject, |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | 'tag' => $tag ?: null |
57 | 57 | ]; |
58 | 58 | |
59 | - $postParameters = array_filter($postParameters, function ($value) { |
|
59 | + $postParameters = array_filter($postParameters, function($value) { |
|
60 | 60 | return $value !== null; |
61 | 61 | }); |
62 | 62 | $this->processRequest($getParameters, $postParameters); |
@@ -24,8 +24,8 @@ |
||
24 | 24 | */ |
25 | 25 | public function getSubscriberLists(): array |
26 | 26 | { |
27 | - $getParameters = []; |
|
28 | - $postParameters = []; |
|
27 | + $getParameters = [ ]; |
|
28 | + $postParameters = [ ]; |
|
29 | 29 | |
30 | 30 | $response = $this->processRequest($getParameters, $postParameters); |
31 | 31 | return $response->lists; |
@@ -25,7 +25,7 @@ |
||
25 | 25 | */ |
26 | 26 | public function deleteSubscriberList(string $listHash) |
27 | 27 | { |
28 | - $getParameters = []; |
|
28 | + $getParameters = [ ]; |
|
29 | 29 | $postParameters = [ |
30 | 30 | 'hash' => $listHash |
31 | 31 | ]; |
@@ -28,16 +28,16 @@ |
||
28 | 28 | public function createSubscriberList( |
29 | 29 | string $listName, |
30 | 30 | string $description = '', |
31 | - array $customFieldsWithValues = [] |
|
31 | + array $customFieldsWithValues = [ ] |
|
32 | 32 | ): \stdClass { |
33 | - $getParameters = []; |
|
33 | + $getParameters = [ ]; |
|
34 | 34 | $postParameters = [ |
35 | 35 | 'name' => $listName, |
36 | 36 | 'description' => $description ?: null, |
37 | 37 | 'custom_fields' => $customFieldsWithValues |
38 | 38 | ]; |
39 | 39 | |
40 | - $postParameters = array_filter($postParameters, function ($value) { |
|
40 | + $postParameters = array_filter($postParameters, function($value) { |
|
41 | 41 | return $value !== null; |
42 | 42 | }); |
43 | 43 | $response = $this->processRequest($getParameters, $postParameters); |
@@ -27,14 +27,14 @@ |
||
27 | 27 | */ |
28 | 28 | public function updateSubscriberList(string $listHash, string $listName, string $description = '') |
29 | 29 | { |
30 | - $getParameters = []; |
|
30 | + $getParameters = [ ]; |
|
31 | 31 | $postParameters = [ |
32 | 32 | 'hash' => $listHash, |
33 | 33 | 'name' => $listName, |
34 | 34 | 'description' => $description ?: null |
35 | 35 | ]; |
36 | 36 | |
37 | - $postParameters = array_filter($postParameters, function ($value) { |
|
37 | + $postParameters = array_filter($postParameters, function($value) { |
|
38 | 38 | return $value !== null; |
39 | 39 | }); |
40 | 40 | $this->processRequest($getParameters, $postParameters); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * @param array $postRequestParams |
65 | 65 | * @return \stdClass |
66 | 66 | */ |
67 | - protected function processRequest(array $getRequestParams = [], array $postRequestParams = []): \stdClass |
|
67 | + protected function processRequest(array $getRequestParams = [ ], array $postRequestParams = [ ]): \stdClass |
|
68 | 68 | { |
69 | 69 | $apiResponse = $this->sendRequest( |
70 | 70 | $this->generateGetParamsString($getRequestParams), |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | throw new FreshMailConnectionException(); |
120 | 120 | } |
121 | 121 | if ($response->status !== 'OK') { |
122 | - $this->errorHandler->raiseException($response->errors[0]); |
|
122 | + $this->errorHandler->raiseException($response->errors[ 0 ]); |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 |