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.
Completed
Push — master ( 0c2a83...ac7f79 )
by sebastian
9s
created
src/Facade/CalDavClient.php 2 patches
Spacing   +38 added lines, -57 removed lines patch added patch discarded remove patch
@@ -137,15 +137,15 @@  discard block
 block discarded – undo
137 137
      * @param Request $http_request
138 138
      * @return mixed|\Psr\Http\Message\ResponseInterface
139 139
      */
140
-    private function makeRequest(Request $http_request){
141
-        try{
140
+    private function makeRequest(Request $http_request) {
141
+        try {
142 142
             return $this->client->send($http_request, [
143 143
                 'auth'    => [$this->user, $this->password, $this->authtype],
144 144
                 'timeout' => $this->timeout
145 145
             ]);
146 146
         }
147
-        catch (ClientException $ex){
148
-            switch($ex->getCode()){
147
+        catch (ClientException $ex) {
148
+            switch ($ex->getCode()) {
149 149
                 case 401:
150 150
                     throw new UserUnAuthorizedException();
151 151
                     break;
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
 
174 174
         $res     = $http_response->hasHeader(self::DAVHeader);
175 175
         $options = [];
176
-        if($res){
176
+        if ($res) {
177 177
             $val = $http_response->getHeaderLine(self::DAVHeader);
178
-            if(!empty($val)){
178
+            if (!empty($val)) {
179 179
                 $options = explode(', ', $val);
180 180
             }
181 181
         }
@@ -189,14 +189,13 @@  discard block
 block discarded – undo
189 189
     public function getUserPrincipal()
190 190
     {
191 191
         $http_response = $this->makeRequest(
192
-            RequestFactory::createPropFindRequest
193
-            (
192
+            RequestFactory::createPropFindRequest(
194 193
                 $this->server_url,
195 194
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::PrincipalRequestType)->getContent()
196 195
             )
197 196
         );
198 197
 
199
-        return new UserPrincipalResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode());
198
+        return new UserPrincipalResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode());
200 199
     }
201 200
 
202 201
     /**
@@ -206,14 +205,13 @@  discard block
 block discarded – undo
206 205
     public function getCalendarHome($principal_url)
207 206
     {
208 207
         $http_response = $this->makeRequest(
209
-            RequestFactory::createPropFindRequest
210
-            (
208
+            RequestFactory::createPropFindRequest(
211 209
                 $principal_url,
212 210
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarHomeRequestType)->getContent()
213 211
             )
214 212
         );
215 213
 
216
-        return new CalendarHomesResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode());
214
+        return new CalendarHomesResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode());
217 215
     }
218 216
 
219 217
     /**
@@ -227,8 +225,7 @@  discard block
 block discarded – undo
227 225
         $uid           = $vo->getUID();
228 226
         $resource_url  = $calendar_home_set.$uid;
229 227
         $http_response = $this->makeRequest(
230
-            RequestFactory::createMakeCalendarRequest
231
-            (
228
+            RequestFactory::createMakeCalendarRequest(
232 229
                 $resource_url,
233 230
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarCreateRequestType, [$vo])->getContent()
234 231
             )
@@ -244,14 +241,13 @@  discard block
 block discarded – undo
244 241
     public function getCalendars($calendar_home_set_url)
245 242
     {
246 243
         $http_response = $this->makeRequest(
247
-            RequestFactory::createPropFindRequest
248
-            (
244
+            RequestFactory::createPropFindRequest(
249 245
                 $calendar_home_set_url,
250 246
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarsRequestType)->getContent()
251 247
             )
252 248
         );
253 249
 
254
-        return new GetCalendarsResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode());
250
+        return new GetCalendarsResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode());
255 251
     }
256 252
 
257 253
     /**
@@ -261,15 +257,14 @@  discard block
 block discarded – undo
261 257
     public function getCalendar($calendar_url)
262 258
     {
263 259
         $http_response = $this->makeRequest(
264
-            RequestFactory::createPropFindRequest
265
-            (
260
+            RequestFactory::createPropFindRequest(
266 261
                 $calendar_url,
267 262
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarRequestType)->getContent(),
268 263
                 0
269 264
             )
270 265
         );
271 266
 
272
-        return new GetCalendarResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode());
267
+        return new GetCalendarResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode());
273 268
     }
274 269
 
275 270
 
@@ -282,14 +277,13 @@  discard block
 block discarded – undo
282 277
     {
283 278
 
284 279
         $http_response = $this->makeRequest(
285
-            RequestFactory::createReportRequest
286
-            (
280
+            RequestFactory::createReportRequest(
287 281
                 $calendar_url,
288 282
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarSyncRequestType, [$sync_token])->getContent()
289 283
             )
290 284
         );
291 285
 
292
-        return new CalendarSyncInfoResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode());
286
+        return new CalendarSyncInfoResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode());
293 287
     }
294 288
 
295 289
     /**
@@ -302,19 +296,17 @@  discard block
 block discarded – undo
302 296
         $uid           = $vo->getUID();
303 297
         $resource_url  = $calendar_url.$uid.self::SchedulingInformationSuffix;
304 298
         $http_response = $this->makeRequest(
305
-            RequestFactory::createPutRequest
306
-            (
299
+            RequestFactory::createPutRequest(
307 300
                 $resource_url,
308 301
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::EventCreateRequestType, [$vo])->getContent()
309 302
             )
310 303
         );
311 304
         $etag = $http_response->hasHeader(self::ETagHeader) ? $http_response->getHeaderLine(self::ETagHeader) : null;
312
-        return new EventCreatedResponse
313
-        (
305
+        return new EventCreatedResponse(
314 306
             $uid,
315 307
             $etag,
316 308
             $resource_url,
317
-            (string)$http_response->getBody(),
309
+            (string) $http_response->getBody(),
318 310
             $http_response->getStatusCode()
319 311
         );
320 312
     }
@@ -330,20 +322,18 @@  discard block
 block discarded – undo
330 322
         $uid           = $vo->getUID();
331 323
         $resource_url  = $calendar_url.$uid.self::SchedulingInformationSuffix;
332 324
         $http_response = $this->makeRequest(
333
-            RequestFactory::createPutRequest
334
-            (
325
+            RequestFactory::createPutRequest(
335 326
                 $resource_url,
336 327
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::EventUpdateRequestType, [$vo])->getContent(),
337 328
                 $etag
338 329
             )
339 330
         );
340 331
         $etag = $http_response->hasHeader(self::ETagHeader) ? $http_response->getHeaderLine(self::ETagHeader) : null;
341
-        return new EventUpdatedResponse
342
-        (
332
+        return new EventUpdatedResponse(
343 333
             $uid,
344 334
             $etag,
345 335
             $resource_url,
346
-            (string)$http_response->getBody(),
336
+            (string) $http_response->getBody(),
347 337
             $http_response->getStatusCode()
348 338
         );
349 339
     }
@@ -357,16 +347,14 @@  discard block
 block discarded – undo
357 347
     public function deleteEvent($calendar_url, $uid, $etag = null)
358 348
     {
359 349
         $http_response = $this->makeRequest(
360
-            RequestFactory::createDeleteRequest
361
-            (
350
+            RequestFactory::createDeleteRequest(
362 351
                 $calendar_url.$uid.self::SchedulingInformationSuffix,
363 352
                 $etag
364 353
             )
365 354
         );
366 355
 
367
-        return new EventDeletedResponse
368
-        (
369
-            (string)$http_response->getBody(), $http_response->getStatusCode()
356
+        return new EventDeletedResponse(
357
+            (string) $http_response->getBody(), $http_response->getStatusCode()
370 358
         );
371 359
     }
372 360
 
@@ -374,15 +362,14 @@  discard block
 block discarded – undo
374 362
      * @param string $event_url
375 363
      * @return string
376 364
      */
377
-    public function getEventVCardBy($event_url){
365
+    public function getEventVCardBy($event_url) {
378 366
         $http_response = $this->makeRequest(
379
-            RequestFactory::createGetRequest
380
-            (
367
+            RequestFactory::createGetRequest(
381 368
                 $event_url
382 369
             )
383 370
         );
384 371
 
385
-        $ical = (string)$http_response->getBody();
372
+        $ical = (string) $http_response->getBody();
386 373
         return $ical;
387 374
     }
388 375
 
@@ -394,17 +381,15 @@  discard block
 block discarded – undo
394 381
     public function getEventsBy($calendar_url, array $events_urls)
395 382
     {
396 383
         $http_response = $this->makeRequest(
397
-            RequestFactory::createReportRequest
398
-            (
384
+            RequestFactory::createReportRequest(
399 385
                 $calendar_url,
400 386
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarMultiGetRequestType, [$events_urls])->getContent()
401 387
             )
402 388
         );
403 389
 
404
-        return new ResourceCollectionResponse
405
-        (
390
+        return new ResourceCollectionResponse(
406 391
             $this->server_url,
407
-            (string)$http_response->getBody(),
392
+            (string) $http_response->getBody(),
408 393
             $http_response->getStatusCode()
409 394
         );
410 395
     }
@@ -418,17 +403,15 @@  discard block
 block discarded – undo
418 403
     {
419 404
 
420 405
         $http_response = $this->makeRequest(
421
-            RequestFactory::createReportRequest
422
-            (
406
+            RequestFactory::createReportRequest(
423 407
                 $calendar_url,
424 408
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarQueryRequestType, [$filter])->getContent()
425 409
             )
426 410
         );
427 411
 
428
-        return new ResourceCollectionResponse
429
-        (
412
+        return new ResourceCollectionResponse(
430 413
             $this->server_url,
431
-            (string)$http_response->getBody(),
414
+            (string) $http_response->getBody(),
432 415
             $http_response->getStatusCode()
433 416
         );
434 417
     }
@@ -441,16 +424,14 @@  discard block
 block discarded – undo
441 424
     public function deleteCalendar($calendar_url, $etag = null)
442 425
     {
443 426
         $http_response = $this->makeRequest(
444
-            RequestFactory::createDeleteRequest
445
-            (
427
+            RequestFactory::createDeleteRequest(
446 428
                 $calendar_url,
447 429
                 $etag
448 430
             )
449 431
         );
450 432
 
451
-        return new CalendarDeletedResponse
452
-        (
453
-            $this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode()
433
+        return new CalendarDeletedResponse(
434
+            $this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode()
454 435
         );
455 436
     }
456 437
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -143,8 +143,7 @@
 block discarded – undo
143 143
                 'auth'    => [$this->user, $this->password, $this->authtype],
144 144
                 'timeout' => $this->timeout
145 145
             ]);
146
-        }
147
-        catch (ClientException $ex){
146
+        } catch (ClientException $ex){
148 147
             switch($ex->getCode()){
149 148
                 case 401:
150 149
                     throw new UserUnAuthorizedException();
Please login to merge, or discard this patch.