GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Pull Request — master (#7)
by
unknown
02:10
created
src/Facade/CalDavClient.php 1 patch
Spacing   +39 added lines, -58 removed lines patch added patch discarded remove patch
@@ -139,15 +139,15 @@  discard block
 block discarded – undo
139 139
      * @param Request $http_request
140 140
      * @return mixed|\Psr\Http\Message\ResponseInterface
141 141
      */
142
-    private function makeRequest(Request $http_request){
143
-        try{
142
+    private function makeRequest(Request $http_request) {
143
+        try {
144 144
             return $this->client->send($http_request, [
145 145
                 'auth'    => [$this->user, $this->password, $this->authtype],
146 146
                 'timeout' => $this->timeout
147 147
             ]);
148 148
         }
149
-        catch (ClientException $ex){
150
-            switch($ex->getCode()){
149
+        catch (ClientException $ex) {
150
+            switch ($ex->getCode()) {
151 151
                 case 401:
152 152
                     throw new UserUnAuthorizedException();
153 153
                     break;
@@ -175,9 +175,9 @@  discard block
 block discarded – undo
175 175
 
176 176
         $res     = $http_response->hasHeader(self::DAVHeader);
177 177
         $options = [];
178
-        if($res){
178
+        if ($res) {
179 179
             $val = $http_response->getHeaderLine(self::DAVHeader);
180
-            if(!empty($val)){
180
+            if (!empty($val)) {
181 181
                 $options = explode(', ', $val);
182 182
             }
183 183
         }
@@ -191,14 +191,13 @@  discard block
 block discarded – undo
191 191
     public function getUserPrincipal()
192 192
     {
193 193
         $http_response = $this->makeRequest(
194
-            RequestFactory::createPropFindRequest
195
-            (
194
+            RequestFactory::createPropFindRequest(
196 195
                 $this->server_url,
197 196
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::PrincipalRequestType)->getContent()
198 197
             )
199 198
         );
200 199
 
201
-        return new UserPrincipalResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode());
200
+        return new UserPrincipalResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode());
202 201
     }
203 202
 
204 203
     /**
@@ -208,14 +207,13 @@  discard block
 block discarded – undo
208 207
     public function getCalendarHome($principal_url)
209 208
     {
210 209
         $http_response = $this->makeRequest(
211
-            RequestFactory::createPropFindRequest
212
-            (
210
+            RequestFactory::createPropFindRequest(
213 211
                 $principal_url,
214 212
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarHomeRequestType)->getContent()
215 213
             )
216 214
         );
217 215
 
218
-        return new CalendarHomesResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode());
216
+        return new CalendarHomesResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode());
219 217
     }
220 218
 
221 219
     /**
@@ -229,10 +227,9 @@  discard block
 block discarded – undo
229 227
         $uid           = $vo->getUID();
230 228
         $resource_name = $vo->getResourceName();
231 229
 
232
-        $resource_url  = $calendar_home_set . ($resource_name ? $resource_name : $uid);
230
+        $resource_url  = $calendar_home_set.($resource_name ? $resource_name : $uid);
233 231
         $http_response = $this->makeRequest(
234
-            RequestFactory::createMakeCalendarRequest
235
-            (
232
+            RequestFactory::createMakeCalendarRequest(
236 233
                 $resource_url,
237 234
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarCreateRequestType, [$vo])->getContent()
238 235
             )
@@ -248,14 +245,13 @@  discard block
 block discarded – undo
248 245
     public function getCalendars($calendar_home_set_url)
249 246
     {
250 247
         $http_response = $this->makeRequest(
251
-            RequestFactory::createPropFindRequest
252
-            (
248
+            RequestFactory::createPropFindRequest(
253 249
                 $calendar_home_set_url,
254 250
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarsRequestType)->getContent()
255 251
             )
256 252
         );
257 253
 
258
-        return new GetCalendarsResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode());
254
+        return new GetCalendarsResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode());
259 255
     }
260 256
 
261 257
     /**
@@ -266,15 +262,14 @@  discard block
 block discarded – undo
266 262
     public function getCalendar($calendar_url, $depth = 0)
267 263
     {
268 264
         $http_response = $this->makeRequest(
269
-            RequestFactory::createPropFindRequest
270
-            (
265
+            RequestFactory::createPropFindRequest(
271 266
                 $calendar_url,
272 267
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarRequestType)->getContent(),
273 268
                 $depth
274 269
             )
275 270
         );
276 271
 
277
-        return new GetCalendarResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode());
272
+        return new GetCalendarResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode());
278 273
     }
279 274
 
280 275
 
@@ -287,14 +282,13 @@  discard block
 block discarded – undo
287 282
     {
288 283
 
289 284
         $http_response = $this->makeRequest(
290
-            RequestFactory::createReportRequest
291
-            (
285
+            RequestFactory::createReportRequest(
292 286
                 $calendar_url,
293 287
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarSyncRequestType, [$sync_token])->getContent()
294 288
             )
295 289
         );
296 290
 
297
-        return new CalendarSyncInfoResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode());
291
+        return new CalendarSyncInfoResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode());
298 292
     }
299 293
 
300 294
     /**
@@ -307,19 +301,17 @@  discard block
 block discarded – undo
307 301
         $uid           = $vo->getUID();
308 302
         $resource_url  = $calendar_url.$uid.self::SchedulingInformationSuffix;
309 303
         $http_response = $this->makeRequest(
310
-            RequestFactory::createPutRequest
311
-            (
304
+            RequestFactory::createPutRequest(
312 305
                 $resource_url,
313 306
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::EventCreateRequestType, [$vo])->getContent()
314 307
             )
315 308
         );
316 309
         $etag = $http_response->hasHeader(self::ETagHeader) ? $http_response->getHeaderLine(self::ETagHeader) : null;
317
-        return new EventCreatedResponse
318
-        (
310
+        return new EventCreatedResponse(
319 311
             $uid,
320 312
             $etag,
321 313
             $resource_url,
322
-            (string)$http_response->getBody(),
314
+            (string) $http_response->getBody(),
323 315
             $http_response->getStatusCode()
324 316
         );
325 317
     }
@@ -335,20 +327,18 @@  discard block
 block discarded – undo
335 327
         $uid           = $vo->getUID();
336 328
         $resource_url  = $calendar_url.$uid.self::SchedulingInformationSuffix;
337 329
         $http_response = $this->makeRequest(
338
-            RequestFactory::createPutRequest
339
-            (
330
+            RequestFactory::createPutRequest(
340 331
                 $resource_url,
341 332
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::EventUpdateRequestType, [$vo])->getContent(),
342 333
                 $etag
343 334
             )
344 335
         );
345 336
         $etag = $http_response->hasHeader(self::ETagHeader) ? $http_response->getHeaderLine(self::ETagHeader) : null;
346
-        return new EventUpdatedResponse
347
-        (
337
+        return new EventUpdatedResponse(
348 338
             $uid,
349 339
             $etag,
350 340
             $resource_url,
351
-            (string)$http_response->getBody(),
341
+            (string) $http_response->getBody(),
352 342
             $http_response->getStatusCode()
353 343
         );
354 344
     }
@@ -362,16 +352,14 @@  discard block
 block discarded – undo
362 352
     public function deleteEvent($calendar_url, $uid, $etag = null)
363 353
     {
364 354
         $http_response = $this->makeRequest(
365
-            RequestFactory::createDeleteRequest
366
-            (
355
+            RequestFactory::createDeleteRequest(
367 356
                 $calendar_url.$uid.self::SchedulingInformationSuffix,
368 357
                 $etag
369 358
             )
370 359
         );
371 360
 
372
-        return new EventDeletedResponse
373
-        (
374
-            (string)$http_response->getBody(), $http_response->getStatusCode()
361
+        return new EventDeletedResponse(
362
+            (string) $http_response->getBody(), $http_response->getStatusCode()
375 363
         );
376 364
     }
377 365
 
@@ -379,15 +367,14 @@  discard block
 block discarded – undo
379 367
      * @param string $event_url
380 368
      * @return string
381 369
      */
382
-    public function getEventVCardBy($event_url){
370
+    public function getEventVCardBy($event_url) {
383 371
         $http_response = $this->makeRequest(
384
-            RequestFactory::createGetRequest
385
-            (
372
+            RequestFactory::createGetRequest(
386 373
                 $event_url
387 374
             )
388 375
         );
389 376
 
390
-        $ical = (string)$http_response->getBody();
377
+        $ical = (string) $http_response->getBody();
391 378
         return $ical;
392 379
     }
393 380
 
@@ -399,17 +386,15 @@  discard block
 block discarded – undo
399 386
     public function getEventsBy($calendar_url, array $events_urls)
400 387
     {
401 388
         $http_response = $this->makeRequest(
402
-            RequestFactory::createReportRequest
403
-            (
389
+            RequestFactory::createReportRequest(
404 390
                 $calendar_url,
405 391
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarMultiGetRequestType, [$events_urls])->getContent()
406 392
             )
407 393
         );
408 394
 
409
-        return new ResourceCollectionResponse
410
-        (
395
+        return new ResourceCollectionResponse(
411 396
             $this->server_url,
412
-            (string)$http_response->getBody(),
397
+            (string) $http_response->getBody(),
413 398
             $http_response->getStatusCode()
414 399
         );
415 400
     }
@@ -423,17 +408,15 @@  discard block
 block discarded – undo
423 408
     {
424 409
 
425 410
         $http_response = $this->makeRequest(
426
-            RequestFactory::createReportRequest
427
-            (
411
+            RequestFactory::createReportRequest(
428 412
                 $calendar_url,
429 413
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarQueryRequestType, [$filter])->getContent()
430 414
             )
431 415
         );
432 416
 
433
-        return new ResourceCollectionResponse
434
-        (
417
+        return new ResourceCollectionResponse(
435 418
             $this->server_url,
436
-            (string)$http_response->getBody(),
419
+            (string) $http_response->getBody(),
437 420
             $http_response->getStatusCode()
438 421
         );
439 422
     }
@@ -446,16 +429,14 @@  discard block
 block discarded – undo
446 429
     public function deleteCalendar($calendar_url, $etag = null)
447 430
     {
448 431
         $http_response = $this->makeRequest(
449
-            RequestFactory::createDeleteRequest
450
-            (
432
+            RequestFactory::createDeleteRequest(
451 433
                 $calendar_url,
452 434
                 $etag
453 435
             )
454 436
         );
455 437
 
456
-        return new CalendarDeletedResponse
457
-        (
458
-            (string)$http_response->getBody(), $http_response->getStatusCode()
438
+        return new CalendarDeletedResponse(
439
+            (string) $http_response->getBody(), $http_response->getStatusCode()
459 440
         );
460 441
     }
461 442
 }
Please login to merge, or discard this patch.