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
Push — master ( ed7ea5...30c8a3 )
by sebastian
04:00 queued 01:52
created
src/Facade/CalDavClient.php 1 patch
Spacing   +39 added lines, -58 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,10 +225,9 @@  discard block
 block discarded – undo
227 225
         $uid           = $vo->getUID();
228 226
         $resource_name = $vo->getResourceName();
229 227
 
230
-        $resource_url  = $calendar_home_set . ($resource_name ? $resource_name : $uid);
228
+        $resource_url  = $calendar_home_set.($resource_name ? $resource_name : $uid);
231 229
         $http_response = $this->makeRequest(
232
-            RequestFactory::createMakeCalendarRequest
233
-            (
230
+            RequestFactory::createMakeCalendarRequest(
234 231
                 $resource_url,
235 232
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarCreateRequestType, [$vo])->getContent()
236 233
             )
@@ -246,14 +243,13 @@  discard block
 block discarded – undo
246 243
     public function getCalendars($calendar_home_set_url)
247 244
     {
248 245
         $http_response = $this->makeRequest(
249
-            RequestFactory::createPropFindRequest
250
-            (
246
+            RequestFactory::createPropFindRequest(
251 247
                 $calendar_home_set_url,
252 248
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarsRequestType)->getContent()
253 249
             )
254 250
         );
255 251
 
256
-        return new GetCalendarsResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode());
252
+        return new GetCalendarsResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode());
257 253
     }
258 254
 
259 255
     /**
@@ -263,15 +259,14 @@  discard block
 block discarded – undo
263 259
     public function getCalendar($calendar_url)
264 260
     {
265 261
         $http_response = $this->makeRequest(
266
-            RequestFactory::createPropFindRequest
267
-            (
262
+            RequestFactory::createPropFindRequest(
268 263
                 $calendar_url,
269 264
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarRequestType)->getContent(),
270 265
                 0
271 266
             )
272 267
         );
273 268
 
274
-        return new GetCalendarResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode());
269
+        return new GetCalendarResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode());
275 270
     }
276 271
 
277 272
 
@@ -284,14 +279,13 @@  discard block
 block discarded – undo
284 279
     {
285 280
 
286 281
         $http_response = $this->makeRequest(
287
-            RequestFactory::createReportRequest
288
-            (
282
+            RequestFactory::createReportRequest(
289 283
                 $calendar_url,
290 284
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarSyncRequestType, [$sync_token])->getContent()
291 285
             )
292 286
         );
293 287
 
294
-        return new CalendarSyncInfoResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode());
288
+        return new CalendarSyncInfoResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode());
295 289
     }
296 290
 
297 291
     /**
@@ -304,19 +298,17 @@  discard block
 block discarded – undo
304 298
         $uid           = $vo->getUID();
305 299
         $resource_url  = $calendar_url.$uid.self::SchedulingInformationSuffix;
306 300
         $http_response = $this->makeRequest(
307
-            RequestFactory::createPutRequest
308
-            (
301
+            RequestFactory::createPutRequest(
309 302
                 $resource_url,
310 303
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::EventCreateRequestType, [$vo])->getContent()
311 304
             )
312 305
         );
313 306
         $etag = $http_response->hasHeader(self::ETagHeader) ? $http_response->getHeaderLine(self::ETagHeader) : null;
314
-        return new EventCreatedResponse
315
-        (
307
+        return new EventCreatedResponse(
316 308
             $uid,
317 309
             $etag,
318 310
             $resource_url,
319
-            (string)$http_response->getBody(),
311
+            (string) $http_response->getBody(),
320 312
             $http_response->getStatusCode()
321 313
         );
322 314
     }
@@ -332,20 +324,18 @@  discard block
 block discarded – undo
332 324
         $uid           = $vo->getUID();
333 325
         $resource_url  = $calendar_url.$uid.self::SchedulingInformationSuffix;
334 326
         $http_response = $this->makeRequest(
335
-            RequestFactory::createPutRequest
336
-            (
327
+            RequestFactory::createPutRequest(
337 328
                 $resource_url,
338 329
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::EventUpdateRequestType, [$vo])->getContent(),
339 330
                 $etag
340 331
             )
341 332
         );
342 333
         $etag = $http_response->hasHeader(self::ETagHeader) ? $http_response->getHeaderLine(self::ETagHeader) : null;
343
-        return new EventUpdatedResponse
344
-        (
334
+        return new EventUpdatedResponse(
345 335
             $uid,
346 336
             $etag,
347 337
             $resource_url,
348
-            (string)$http_response->getBody(),
338
+            (string) $http_response->getBody(),
349 339
             $http_response->getStatusCode()
350 340
         );
351 341
     }
@@ -359,16 +349,14 @@  discard block
 block discarded – undo
359 349
     public function deleteEvent($calendar_url, $uid, $etag = null)
360 350
     {
361 351
         $http_response = $this->makeRequest(
362
-            RequestFactory::createDeleteRequest
363
-            (
352
+            RequestFactory::createDeleteRequest(
364 353
                 $calendar_url.$uid.self::SchedulingInformationSuffix,
365 354
                 $etag
366 355
             )
367 356
         );
368 357
 
369
-        return new EventDeletedResponse
370
-        (
371
-            (string)$http_response->getBody(), $http_response->getStatusCode()
358
+        return new EventDeletedResponse(
359
+            (string) $http_response->getBody(), $http_response->getStatusCode()
372 360
         );
373 361
     }
374 362
 
@@ -376,15 +364,14 @@  discard block
 block discarded – undo
376 364
      * @param string $event_url
377 365
      * @return string
378 366
      */
379
-    public function getEventVCardBy($event_url){
367
+    public function getEventVCardBy($event_url) {
380 368
         $http_response = $this->makeRequest(
381
-            RequestFactory::createGetRequest
382
-            (
369
+            RequestFactory::createGetRequest(
383 370
                 $event_url
384 371
             )
385 372
         );
386 373
 
387
-        $ical = (string)$http_response->getBody();
374
+        $ical = (string) $http_response->getBody();
388 375
         return $ical;
389 376
     }
390 377
 
@@ -396,17 +383,15 @@  discard block
 block discarded – undo
396 383
     public function getEventsBy($calendar_url, array $events_urls)
397 384
     {
398 385
         $http_response = $this->makeRequest(
399
-            RequestFactory::createReportRequest
400
-            (
386
+            RequestFactory::createReportRequest(
401 387
                 $calendar_url,
402 388
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarMultiGetRequestType, [$events_urls])->getContent()
403 389
             )
404 390
         );
405 391
 
406
-        return new ResourceCollectionResponse
407
-        (
392
+        return new ResourceCollectionResponse(
408 393
             $this->server_url,
409
-            (string)$http_response->getBody(),
394
+            (string) $http_response->getBody(),
410 395
             $http_response->getStatusCode()
411 396
         );
412 397
     }
@@ -420,17 +405,15 @@  discard block
 block discarded – undo
420 405
     {
421 406
 
422 407
         $http_response = $this->makeRequest(
423
-            RequestFactory::createReportRequest
424
-            (
408
+            RequestFactory::createReportRequest(
425 409
                 $calendar_url,
426 410
                 CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarQueryRequestType, [$filter])->getContent()
427 411
             )
428 412
         );
429 413
 
430
-        return new ResourceCollectionResponse
431
-        (
414
+        return new ResourceCollectionResponse(
432 415
             $this->server_url,
433
-            (string)$http_response->getBody(),
416
+            (string) $http_response->getBody(),
434 417
             $http_response->getStatusCode()
435 418
         );
436 419
     }
@@ -443,16 +426,14 @@  discard block
 block discarded – undo
443 426
     public function deleteCalendar($calendar_url, $etag = null)
444 427
     {
445 428
         $http_response = $this->makeRequest(
446
-            RequestFactory::createDeleteRequest
447
-            (
429
+            RequestFactory::createDeleteRequest(
448 430
                 $calendar_url,
449 431
                 $etag
450 432
             )
451 433
         );
452 434
 
453
-        return new CalendarDeletedResponse
454
-        (
455
-            (string)$http_response->getBody(), $http_response->getStatusCode()
435
+        return new CalendarDeletedResponse(
436
+            (string) $http_response->getBody(), $http_response->getStatusCode()
456 437
         );
457 438
     }
458 439
 }
Please login to merge, or discard this patch.