Skip to content

Commit 527387b

Browse files
committed
Fix Code Sniffer errors.
1 parent 19751b6 commit 527387b

17 files changed

+0
-61
lines changed

src/main/php/Gomoob/Pushwoosh/Client/CURLClient.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ public function pushwooshCall($method, array $data)
9494
'curl_info' => $info
9595
]
9696
);
97-
9897
}
9998

10099
$jsonResult = json_decode($response, true);
@@ -116,7 +115,6 @@ public function pushwooshCall($method, array $data)
116115

117116
// Close the CURL handle
118117
$this->curlRequest->close();
119-
120118
}
121119

122120
// Close the CURL handle

src/main/php/Gomoob/Pushwoosh/Client/Pushwoosh.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ public function createMessage(CreateMessageRequest $createMessageRequest)
118118
// Sets the 'applicationsGroup' attribute
119119
} elseif (isset($this->applicationsGroup)) {
120120
$createMessageRequest->setApplicationsGroup($this->applicationsGroup);
121-
122121
}
123-
124122
}
125123

126124
// If the 'auth' parameter is not set in the request we try to get it from the Pushwoosh client

src/main/php/Gomoob/Pushwoosh/Curl/CurlRequest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,9 @@ public function __construct($url = null)
4848
// The provided URL must be valid
4949
if (!$this->isUrlValid($url)) {
5050
throw new \Exception('Invalid URL provided \'' . $url . '\' !', -1, null);
51-
5251
}
5352

5453
$this->init($url);
55-
5654
}
5755

5856
}
@@ -92,7 +90,6 @@ public function init($url = null)
9290
// If a previous CURL handle exists close it
9391
if ($this->ch) {
9492
$this->close();
95-
9693
}
9794

9895
$this->ch = curl_init($url);

src/main/php/Gomoob/Pushwoosh/JsonUtils.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public static function mergeJsonSerializables(&$array /*, \JsonSerializable ...
2929
$arguments = func_get_args();
3030

3131
for ($i = 1; $i < $numberOfArguments; ++$i) {
32-
3332
$argument = $arguments[$i];
3433

3534
if (isset($argument)) {

src/main/php/Gomoob/Pushwoosh/Model/Condition/DateCondition.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,14 @@ public function jsonSerialize()
105105

106106
// The operand is an array of date and time objects
107107
if (is_array($this->operand)) {
108-
109108
$operandWithString = [];
110109

111110
foreach ($this->operand as $dateAndTime) {
112-
113111
$operandWithString[] = $dateAndTime->format('Y-m-d h:i');
114-
115112
}
116-
117113
} // The operand is a date and time object
118114
else {
119-
120115
$operandWithString = $this->operand->format('Y-m-d h:i');
121-
122116
}
123117

124118
return [

src/main/php/Gomoob/Pushwoosh/Model/Notification/Notification.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,6 @@ public function setSendDate(/* \DateTime */ $sendDate)
10591059
// Invalid send date provided
10601060
} else {
10611061
throw new PushwooshException('Invalid send date provided !');
1062-
10631062
}
10641063

10651064
return $this;

src/main/php/Gomoob/Pushwoosh/Model/Request/AbstractRequest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ public function getAuth()
3333
{
3434
// If the `auth` parameter is not supported we throw an exception
3535
if (!$this->isAuthSupported()) {
36-
3736
throw new PushwooshException('This request does not support the \'auth\' parameter !');
38-
3937
}
4038

4139
return $this->auth;
@@ -48,9 +46,7 @@ public function setAuth($auth)
4846
{
4947
// If the `auth` parameter is not supported we throw an exception
5048
if (!$this->isAuthSupported()) {
51-
5249
throw new PushwooshException('This request does not support the \'auth\' parameter !');
53-
5450
}
5551

5652
$this->auth = $auth;

src/main/php/Gomoob/Pushwoosh/Model/Request/CreateTargetedMessageRequest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,6 @@ public function setSendDate(/* \DateTime */ $sendDate)
539539
// Invalid send date provided
540540
} else {
541541
throw new PushwooshException('Invalid send date provided !');
542-
543542
}
544543

545544
return $this;

src/main/php/Gomoob/Pushwoosh/Model/Request/DeleteMessageRequest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,11 @@ public function jsonSerialize()
6060
// The 'auth' parameter must have been set
6161
if (!isset($this->auth)) {
6262
throw new PushwooshException('The \'auth\' property is not set !');
63-
6463
}
6564

6665
// The 'message' parameter must have been set
6766
if (!isset($this->message)) {
6867
throw new PushwooshException('The \'message\' property is not set !');
69-
7068
}
7169

7270
return [

src/main/php/Gomoob/Pushwoosh/Model/Response/CreateMessageResponse.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ public static function create(array $json)
4242
// If 'Messages' are provided
4343
if (array_key_exists('Messages', $json['response'])) {
4444
$createMessageResponseResponse->setMessages($json['response']['Messages']);
45-
4645
}
4746

4847
$createMessageResponse->setResponse($createMessageResponseResponse);
49-
5048
}
5149

5250
return $createMessageResponse;

src/main/php/Gomoob/Pushwoosh/Model/Response/CreateTargetedMessageResponse.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ public static function create(array $json)
4545
}
4646

4747
$createTargetedMessageResponse->setResponse($createTargetedMessageResponseResponse);
48-
4948
}
5049

5150
return $createTargetedMessageResponse;

src/main/php/Gomoob/Pushwoosh/Model/Response/GetNearestZoneResponse.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public static function create(array $json)
4444
$getNearestZoneResponseResponse->setName($json['response']['name']);
4545
$getNearestZoneResponseResponse->setRange($json['response']['range']);
4646
$getNearestZoneResponse->setResponse($getNearestZoneResponseResponse);
47-
4847
}
4948

5049
return $getNearestZoneResponse;

src/main/php/Gomoob/Pushwoosh/Model/Response/GetTagsResponse.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ public static function create(array $json)
4242
// If a 'result' is provided
4343
if (array_key_exists('result', $json['response'])) {
4444
$getTagsResponseResponse->setResult($json['response']['result']);
45-
4645
}
4746

4847
$getTagsResponse->setResponse($getTagsResponseResponse);
49-
5048
}
5149

5250
return $getTagsResponse;

src/test/php/Gomoob/Pushwoosh/Client/CURLClientTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ public function testPushwooshCall()
4545
);
4646

4747
$this->fail('Must have thrown a PushwooshException !');
48-
4948
} catch (PushwooshException $ex) {
5049
$this->assertSame(
5150
'Bad response encountered while requesting the Pushwoosh web services using CURL !',
@@ -57,7 +56,6 @@ public function testPushwooshCall()
5756
$this->assertCount(1, $data);
5857
$this->assertTrue(array_key_exists('curl_info', $data));
5958
$this->assertSame('CURL_INFO', $data['curl_info']);
60-
6159
}
6260

6361
// Second test with a CURL error encountered
@@ -85,7 +83,6 @@ public function testPushwooshCall()
8583
);
8684

8785
$this->fail('Must have thrown a PushwooshException !');
88-
8986
} catch (PushwooshException $ex) {
9087
$this->assertSame(
9188
'CURL error encountered while requesting the Pushwoosh web services using CURL !',

src/test/php/Gomoob/Pushwoosh/Client/PushwooshTest.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,8 @@ public function testCreateMessage()
9696
try {
9797
$pushwoosh->createMessage($createMessageRequest);
9898
$this->fail('Must have thrown a PushwooshException !');
99-
10099
} catch (PushwooshException $pe) {
101100
// Expected
102-
103101
}
104102

105103
// Test with both the 'application' and 'applicationsGroup' parameters set
@@ -108,21 +106,17 @@ public function testCreateMessage()
108106
try {
109107
$pushwoosh->createMessage($createMessageRequest);
110108
$this->fail('Must have thrown a PushwooshException !');
111-
112109
} catch (PushwooshException $pe) {
113110
// Expected
114-
115111
}
116112

117113
// Test with the 'auth' parameter provided
118114
$pushwoosh->setApplicationsGroup(null);
119115
try {
120116
$pushwoosh->createMessage($createMessageRequest);
121117
$this->fail('Must have thrown a PushwooshException !');
122-
123118
} catch (PushwooshException $pe) {
124119
// Expected
125-
126120
}
127121

128122
// Call with 'application' and 'auth' set in the Pushwoosh client
@@ -346,10 +340,8 @@ public function testDeleteMessage()
346340
try {
347341
$pushwoosh->deleteMessage($deleteMessageRequest);
348342
$this->fail('Must have thrown a PushwooshException !');
349-
350343
} catch (PushwooshException $pe) {
351344
// Expected
352-
353345
}
354346

355347
// Test with the 'auth' parameter defined in the Pushwoosh client
@@ -411,10 +403,8 @@ public function testGetNearestZone()
411403
try {
412404
$pushwoosh->getNearestZone($getNearestZoneRequest);
413405
$this->fail('Must have thrown a PushwooshException !');
414-
415406
} catch (PushwooshException $pe) {
416407
// Expected
417-
418408
}
419409

420410
// Test with the 'application' parameter defined in the Pushwoosh client
@@ -515,21 +505,17 @@ public function testGetTags()
515505
try {
516506
$pushwoosh->getTags($getTagsRequest);
517507
$this->fail('Must have thrown a PushwooshException !');
518-
519508
} catch (PushwooshException $pe) {
520509
// Expected
521-
522510
}
523511

524512
// Test with the 'auth' parameter not defined
525513
$pushwoosh->setApplication('APPLICATION');
526514
try {
527515
$pushwoosh->getTags($getTagsRequest);
528516
$this->fail('Must have thrown a PushwooshException !');
529-
530517
} catch (PushwooshException $pe) {
531518
// Expected
532-
533519
}
534520

535521
// Test with the 'application' and 'auth' parameters definied in the Pushwoosh client
@@ -626,10 +612,8 @@ public function testPushStat()
626612
try {
627613
$pushwoosh->pushStat($pushStatRequest);
628614
$this->fail('Must have thrown a PushwooshException !');
629-
630615
} catch (PushwooshException $pe) {
631616
// Expected
632-
633617
}
634618

635619
// Test with the 'application' parameter defined in the Pushwoosh client
@@ -694,10 +678,8 @@ public function testRegisterDevice()
694678
try {
695679
$pushwoosh->registerDevice($registerDeviceRequest);
696680
$this->fail('Must have thrown a PushwooshException !');
697-
698681
} catch (PushwooshException $pe) {
699682
// Expected
700-
701683
}
702684

703685
// Test with the 'application' parameter defined in the Pushwoosh client
@@ -760,10 +742,8 @@ public function testSetBadge()
760742
try {
761743
$pushwoosh->setBadge($setBadgeRequest);
762744
$this->fail('Must have thrown a PushwooshException !');
763-
764745
} catch (PushwooshException $pe) {
765746
// Expected
766-
767747
}
768748

769749
// Test with the 'application' parameter defined in the Pushwoosh client
@@ -826,10 +806,8 @@ public function testSetTags()
826806
try {
827807
$pushwoosh->setTags($setTagsRequest);
828808
$this->fail('Must have thrown a PushwooshException !');
829-
830809
} catch (PushwooshException $pe) {
831810
// Expected
832-
833811
}
834812

835813
// Test with the 'application' parameter defined in the Pushwoosh client
@@ -890,10 +868,8 @@ public function testUnregisterDevice()
890868
try {
891869
$pushwoosh->unregisterDevice($unregisterDeviceRequest);
892870
$this->fail('Must have thrown a PushwooshException !');
893-
894871
} catch (PushwooshException $pe) {
895872
// Expected
896-
897873
}
898874

899875
// Test with the 'application' parameter defined in the Pushwoosh client

src/test/php/Gomoob/Pushwoosh/Model/Notification/NotificationTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,20 +341,16 @@ public function testGetSetSendDate()
341341
try {
342342
$notification->setSendDate('aaa');
343343
$this->fail('Must have thrown a PushwooshException !');
344-
345344
} catch (PushwooshException $pe) {
346345
// Expected
347-
348346
}
349347

350348
// Test with a send date which is neither a \DateTime neither a string
351349
try {
352350
$notification->setSendDate(654);
353351
$this->fail('Must have thrown a PushwooshException !');
354-
355352
} catch (PushwooshException $pe) {
356353
// Expected
357-
358354
}
359355

360356
// Test with 'now'

src/test/php/Gomoob/Pushwoosh/Model/Request/CreateTargetedMessageRequestTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ public function testGetSetSendDate()
187187
try {
188188
$createTargetedMessageRequest->setSendDate('aaa');
189189
$this->fail('Must have thrown a PushwooshException !');
190-
191190
} catch (PushwooshException $pe) {
192191
// Expected
193192
}
@@ -196,7 +195,6 @@ public function testGetSetSendDate()
196195
try {
197196
$createTargetedMessageRequest->setSendDate(654);
198197
$this->fail('Must have thrown a PushwooshException !');
199-
200198
} catch (PushwooshException $pe) {
201199
// Expected
202200
}

0 commit comments

Comments
 (0)