Skip to content

Commit 0430e51

Browse files
committed
Another round of PHPCS adjustments
1 parent 1bf6e85 commit 0430e51

14 files changed

Lines changed: 16 additions & 38 deletions

src/AbstractGithubObject.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ protected function processResponse(Response $response, $expectedCode = 200)
161161
// Decode the error response and throw an exception.
162162
$error = json_decode($response->body);
163163
$message = isset($error->message) ? $error->message : 'Invalid response received from GitHub.';
164+
164165
throw new UnexpectedResponseException($response, $message, $response->code);
165166
}
166167

src/Package/Activity/Starring.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,10 @@ public function check($owner, $repo)
117117
case '204' :
118118
// This repository is watched by you.
119119
return true;
120-
break;
121120

122121
case '404' :
123122
// This repository is not watched by you.
124123
return false;
125-
break;
126124
}
127125

128126
throw new \UnexpectedValueException('Unexpected response code: ' . $response->code);

src/Package/Activity/Watching.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,10 @@ public function check($owner, $repo)
155155
case '204' :
156156
// This repository is watched by you.
157157
return true;
158-
break;
159158

160159
case '404' :
161160
// This repository is not watched by you.
162161
return false;
163-
break;
164162
}
165163

166164
throw new \UnexpectedValueException('Unexpected response code: ' . $response->code);

src/Package/Authorization.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ public function getRateLimit()
255255

256256
// Decode the error response and throw an exception.
257257
$error = json_decode($response->body);
258+
258259
throw new UnexpectedResponseException($response, $error->message, $response->code);
259260
}
260261

@@ -332,15 +333,20 @@ public function requestToken($clientId, $clientSecret, $code, $redirectUri = '',
332333
{
333334
case 'json' :
334335
$headers['Accept'] = 'application/json';
336+
335337
break;
338+
336339
case 'xml' :
337340
$headers['Accept'] = 'application/xml';
341+
338342
break;
343+
339344
default :
340345
if ($format)
341346
{
342347
throw new \UnexpectedValueException('Invalid format');
343348
}
349+
344350
break;
345351
}
346352

src/Package/Gists.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ public function isStarred($gistId)
352352
// Decode the error response and throw an exception.
353353
$error = json_decode($response->body);
354354
$message = isset($error->message) ? $error->message : 'Invalid response received from GitHub.';
355+
355356
throw new UnexpectedResponseException($response, $message, $response->code);
356357
}
357358

src/Package/Gitignore.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public function get($name, $raw = false)
7373
// Decode the error response and throw an exception.
7474
$error = json_decode($response->body);
7575
$message = isset($error->message) ? $error->message : 'Invalid response received from GitHub.';
76+
7677
throw new UnexpectedResponseException($response, $message, $response->code);
7778
}
7879

src/Package/Markdown.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public function render($text, $mode = 'gfm', $context = null)
6969
// Decode the error response and throw an exception.
7070
$error = json_decode($response->body);
7171
$message = isset($error->message) ? $error->message : 'Invalid response received from GitHub.';
72+
7273
throw new UnexpectedResponseException($response, $message, $response->code);
7374
}
7475

src/Package/Orgs/Members.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,12 @@ public function getList($org)
4848
case 302 :
4949
// Requester is not an organization member.
5050
return false;
51-
break;
5251

5352
case 200 :
5453
return json_decode($response->body);
55-
break;
5654

5755
default :
5856
throw new \UnexpectedValueException('Unexpected response code: ' . $response->code);
59-
break;
6057
}
6158
}
6259

@@ -85,22 +82,18 @@ public function check($org, $user)
8582
case 204 :
8683
// Requester is an organization member and user is a member.
8784
return true;
88-
break;
8985

9086
case 404 :
9187
// Requester is an organization member and user is not a member.
9288
// Requester is not an organization member and is inquiring about themselves.
9389
return false;
94-
break;
9590

9691
case 302 :
9792
// Requester is not an organization member.
9893
return false;
99-
break;
10094

10195
default :
10296
throw new \UnexpectedValueException('Unexpected response code: ' . $response->code);
103-
break;
10497
}
10598
}
10699

@@ -178,16 +171,13 @@ public function checkPublic($org, $user)
178171
case 204 :
179172
// Response if user is a public member.
180173
return true;
181-
break;
182174

183175
case 404 :
184176
// Response if user is not a public member.
185177
return false;
186-
break;
187178

188179
default :
189180
throw new \UnexpectedValueException('Unexpected response code: ' . $response->code);
190-
break;
191181
}
192182
}
193183

src/Package/Orgs/Teams.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,16 +218,13 @@ public function isMember($id, $user)
218218
case 204 :
219219
// Response if user is a member
220220
return true;
221-
break;
222221

223222
case 404 :
224223
// Response if user is not a member
225224
return false;
226-
break;
227225

228226
default :
229227
throw new \UnexpectedValueException('Unexpected response code: ' . $response->code);
230-
break;
231228
}
232229
}
233230

@@ -418,16 +415,13 @@ public function checkRepo($id, $owner, $repo)
418415
case 204 :
419416
// Response if repo is managed by this team.
420417
return true;
421-
break;
422418

423419
case 404 :
424420
// Response if repo is not managed by this team.
425421
return false;
426-
break;
427422

428423
default :
429424
throw new \UnexpectedValueException('Unexpected response code: ' . $response->code);
430-
break;
431425
}
432426
}
433427

src/Package/Pulls.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ public function isMerged($user, $repo, $pullId)
279279
// Decode the error response and throw an exception.
280280
$error = json_decode($response->body);
281281
$message = isset($error->message) ? $error->message : 'Invalid response received from GitHub.';
282+
282283
throw new UnexpectedResponseException($response, $message, $response->code);
283284
}
284285

0 commit comments

Comments
 (0)