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 ( 30c8a3...416e54 )
by sebastian
04:49 queued 03:04
created
src/Facade/Responses/GetCalendarResponse.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     /**
22 22
      * @return string
23 23
      */
24
-    public function getDisplayName(){
24
+    public function getDisplayName() {
25 25
         return isset($this->found_props['displayname']) ? $this->found_props['displayname'] : null;
26 26
     }
27 27
 
@@ -29,14 +29,14 @@  discard block
 block discarded – undo
29 29
      * @see https://tools.ietf.org/html/rfc6578
30 30
      * @return string
31 31
      */
32
-    public function getSyncToken(){
32
+    public function getSyncToken() {
33 33
         return isset($this->found_props['sync-token']) ? $this->found_props['sync-token'] : null;
34 34
     }
35 35
 
36 36
     /**
37 37
      * @return string
38 38
      */
39
-    public function getCTag(){
39
+    public function getCTag() {
40 40
         return isset($this->found_props['getctag']) ? $this->found_props['getctag'] : null;
41 41
     }
42 42
 
Please login to merge, or discard this patch.
src/Facade/Responses/GenericSinglePROPFINDCalDAVResponse.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
      */
79 79
     protected function isValid()
80 80
     {
81
-        return parent::isValid() ;
81
+        return parent::isValid();
82 82
     }
83 83
 
84 84
     /**
Please login to merge, or discard this patch.
Braces   +15 added lines, -7 removed lines patch added patch discarded remove patch
@@ -41,8 +41,12 @@  discard block
 block discarded – undo
41 41
     protected function parse()
42 42
     {
43 43
 
44
-        if (!$this->isValid()) throw new NotValidGenericSingleCalDAVResponseException();
45
-        if (!isset($this->content['response']['propstat'])) return $this;
44
+        if (!$this->isValid()) {
45
+            throw new NotValidGenericSingleCalDAVResponseException();
46
+        }
47
+        if (!isset($this->content['response']['propstat'])) {
48
+            return $this;
49
+        }
46 50
         if (isset($this->content['response']['propstat']['prop']) && isset($this->content['response']['propstat']['status'])) {
47 51
             // all props found
48 52
             $status = $this->content['response']['propstat']['status'];
@@ -62,13 +66,17 @@  discard block
 block discarded – undo
62 66
         // multi props ( found or not found)
63 67
         foreach ($this->content['response']['propstat'] as $propstat) {
64 68
 
65
-            if (!isset($propstat['status']) || !isset($propstat['prop'])) continue;
69
+            if (!isset($propstat['status']) || !isset($propstat['prop'])) {
70
+                continue;
71
+            }
66 72
 
67
-            if ($propstat['status'] == AbstractCalDAVResponse::HttpOKStatus)
68
-                $this->found_props = $propstat['prop'];
73
+            if ($propstat['status'] == AbstractCalDAVResponse::HttpOKStatus) {
74
+                            $this->found_props = $propstat['prop'];
75
+            }
69 76
 
70
-            if ($propstat['status'] == AbstractCalDAVResponse::HttpNotFoundStatus)
71
-                $this->not_found_props = $propstat['prop'];
77
+            if ($propstat['status'] == AbstractCalDAVResponse::HttpNotFoundStatus) {
78
+                            $this->not_found_props = $propstat['prop'];
79
+            }
72 80
         }
73 81
         return $this;
74 82
     }
Please login to merge, or discard this patch.
src/Facade/Responses/CalendarHomesResponse.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     /**
22 22
      * @return string
23 23
      */
24
-    public function getCalendarHomeSetUrl(){
24
+    public function getCalendarHomeSetUrl() {
25 25
         return isset($this->found_props['calendar-home-set']) && isset($this->found_props['calendar-home-set']['href']) ?
26 26
             $this->found_props['calendar-home-set']['href'] : null;
27 27
     }
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
     /**
30 30
      * @return string|null
31 31
      */
32
-    public function getRealCalDAVHost(){
32
+    public function getRealCalDAVHost() {
33 33
         $url = $this->getCalendarHomeSetUrl();
34
-        return !empty($url) ? parse_url($url,PHP_URL_HOST) : null;
34
+        return !empty($url) ? parse_url($url, PHP_URL_HOST) : null;
35 35
     }
36 36
 }
37 37
\ No newline at end of file
Please login to merge, or discard this patch.
src/Facade/Responses/EventDeletedResponse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
     /**
22 22
      * @return bool
23 23
      */
24
-    public function isSuccessFull(){
24
+    public function isSuccessFull() {
25 25
         return $this->code == HttpResponse::HttpCodeNoContent;
26 26
     }
27 27
 }
28 28
\ No newline at end of file
Please login to merge, or discard this patch.
src/Facade/Responses/CalendarSyncInfoResponse.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -22,14 +22,14 @@  discard block
 block discarded – undo
22 22
     /**
23 23
      * @return string|null
24 24
      */
25
-    public function getSyncToken(){
26
-        return isset($this->content['sync-token'])? $this->content['sync-token'] : null;
25
+    public function getSyncToken() {
26
+        return isset($this->content['sync-token']) ? $this->content['sync-token'] : null;
27 27
     }
28 28
 
29 29
     /**
30 30
      * @return bool
31 31
      */
32
-    public function hasAvailableChanges(){
32
+    public function hasAvailableChanges() {
33 33
         return count($this->responses) > 0;
34 34
     }
35 35
 
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
     /**
38 38
      * @return ETagEntityResponse[]
39 39
      */
40
-    public function getUpdates(){
40
+    public function getUpdates() {
41 41
         $res = [];
42
-        foreach ($this->responses as $entity){
43
-            if($entity->getStatus() != HttpResponse::HttpOKStatus) continue;
42
+        foreach ($this->responses as $entity) {
43
+            if ($entity->getStatus() != HttpResponse::HttpOKStatus) continue;
44 44
             $res[] = $entity;
45 45
         }
46 46
         return $res;
@@ -49,10 +49,10 @@  discard block
 block discarded – undo
49 49
     /**
50 50
      * @return ETagEntityResponse[]
51 51
      */
52
-    public function getDeletes(){
52
+    public function getDeletes() {
53 53
         $res = [];
54
-        foreach ($this->responses as $entity){
55
-            if($entity->getStatus() != HttpResponse::HttpNotFoundStatus) continue;
54
+        foreach ($this->responses as $entity) {
55
+            if ($entity->getStatus() != HttpResponse::HttpNotFoundStatus) continue;
56 56
             $res[] = $entity;
57 57
         }
58 58
         return $res;
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,9 @@  discard block
 block discarded – undo
40 40
     public function getUpdates(){
41 41
         $res = [];
42 42
         foreach ($this->responses as $entity){
43
-            if($entity->getStatus() != HttpResponse::HttpOKStatus) continue;
43
+            if($entity->getStatus() != HttpResponse::HttpOKStatus) {
44
+                continue;
45
+            }
44 46
             $res[] = $entity;
45 47
         }
46 48
         return $res;
@@ -52,7 +54,9 @@  discard block
 block discarded – undo
52 54
     public function getDeletes(){
53 55
         $res = [];
54 56
         foreach ($this->responses as $entity){
55
-            if($entity->getStatus() != HttpResponse::HttpNotFoundStatus) continue;
57
+            if($entity->getStatus() != HttpResponse::HttpNotFoundStatus) {
58
+                continue;
59
+            }
56 60
             $res[] = $entity;
57 61
         }
58 62
         return $res;
Please login to merge, or discard this patch.
src/Facade/Responses/AbstractCalDAVResponse.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
      * @param string|null $body
41 41
      * @param int $code
42 42
      */
43
-    public function __construct($server_url = null, $body = null, $code = HttpResponse::HttpCodeOk )
43
+    public function __construct($server_url = null, $body = null, $code = HttpResponse::HttpCodeOk)
44 44
     {
45 45
         parent::__construct($body, $code);
46 46
         $this->server_url = $server_url;
47
-        if(!empty($this->body)) {
48
-            $this->xml     =  simplexml_load_string($this->body, 'SimpleXMLElement', LIBXML_NOCDATA);
49
-            if($this->xml === FALSE)
47
+        if (!empty($this->body)) {
48
+            $this->xml     = simplexml_load_string($this->body, 'SimpleXMLElement', LIBXML_NOCDATA);
49
+            if ($this->xml === FALSE)
50 50
                 throw new XMLResponseParseException();
51 51
             $this->content = $this->toAssocArray($this->xml);
52 52
             $this->parse();
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     {
58 58
     }
59 59
 
60
-    protected function setContent($content){
60
+    protected function setContent($content) {
61 61
         $this->content = $content;
62 62
     }
63 63
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     /**
76 76
      * @return bool
77 77
      */
78
-    protected function isValid(){
78
+    protected function isValid() {
79 79
         return isset($this->content['response']);
80 80
     }
81 81
 }
82 82
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,8 +46,9 @@
 block discarded – undo
46 46
         $this->server_url = $server_url;
47 47
         if(!empty($this->body)) {
48 48
             $this->xml     =  simplexml_load_string($this->body, 'SimpleXMLElement', LIBXML_NOCDATA);
49
-            if($this->xml === FALSE)
50
-                throw new XMLResponseParseException();
49
+            if($this->xml === FALSE) {
50
+                            throw new XMLResponseParseException();
51
+            }
51 52
             $this->content = $this->toAssocArray($this->xml);
52 53
             $this->parse();
53 54
         }
Please login to merge, or discard this patch.
src/Facade/Requests/EventRequestVO.php 1 patch
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -94,8 +94,7 @@  discard block
 block discarded – undo
94 94
      * @param string $location_lat
95 95
      * @param string $location_lng
96 96
      */
97
-    public function __construct
98
-    (
97
+    public function __construct(
99 98
         $prod_id,
100 99
         $title,
101 100
         $description,
@@ -121,7 +120,7 @@  discard block
 block discarded – undo
121 120
         $this->location_lat    = $location_lat;
122 121
         $this->location_lng    = $location_lng;
123 122
         $this->time_zone       = $time_zone;
124
-        if(is_null($this->time_zone)){
123
+        if (is_null($this->time_zone)) {
125 124
             $this->time_zone = new DateTimeZone('UTC');
126 125
         }
127 126
     }
@@ -129,7 +128,7 @@  discard block
 block discarded – undo
129 128
     /**
130 129
      * @param string $uid
131 130
      */
132
-    public function setUID($uid){
131
+    public function setUID($uid) {
133 132
         $this->uid = $uid;
134 133
     }
135 134
 
@@ -216,7 +215,7 @@  discard block
 block discarded – undo
216 215
     /**
217 216
      * @return DateTimeZone
218 217
      */
219
-    public function getTimeZone(){
218
+    public function getTimeZone() {
220 219
         return $this->time_zone;
221 220
     }
222 221
 
Please login to merge, or discard this patch.
src/Facade/Requests/CalendarCreateRequest.php 2 patches
Spacing   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -59,17 +59,15 @@
 block discarded – undo
59 59
                     'attributes'  => ['name' => 'VEVENT']
60 60
                 ]
61 61
             ],
62
-            '{urn:ietf:params:xml:ns:caldav}calendar-timezone' => new Cdata
63
-            (
64
-                ICalTimeZoneBuilder::build
65
-                (
62
+            '{urn:ietf:params:xml:ns:caldav}calendar-timezone' => new Cdata(
63
+                ICalTimeZoneBuilder::build(
66 64
                     $this->vo->getTimezone(),
67 65
                     $this->vo->getDisplayName()
68 66
                 )->render()
69 67
             )
70 68
         ];
71 69
 
72
-        if(!empty($this->vo->getDescription()))
70
+        if (!empty($this->vo->getDescription()))
73 71
             $props['{urn:ietf:params:xml:ns:caldav}calendar-description'] = $this->vo->getDescription();
74 72
 
75 73
         return $service->write('{urn:ietf:params:xml:ns:caldav}mkcalendar',
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,8 +69,9 @@
 block discarded – undo
69 69
             )
70 70
         ];
71 71
 
72
-        if(!empty($this->vo->getDescription()))
73
-            $props['{urn:ietf:params:xml:ns:caldav}calendar-description'] = $this->vo->getDescription();
72
+        if(!empty($this->vo->getDescription())) {
73
+                    $props['{urn:ietf:params:xml:ns:caldav}calendar-description'] = $this->vo->getDescription();
74
+        }
74 75
 
75 76
         return $service->write('{urn:ietf:params:xml:ns:caldav}mkcalendar',
76 77
             [
Please login to merge, or discard this patch.
src/Facade/Utils/ICalTimeZoneBuilder.php 2 patches
Spacing   +26 added lines, -31 removed lines patch added patch discarded remove patch
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
      * @param DateTimeZone $time_zone
32 32
      * @return array
33 33
      */
34
-    private static function calculateTimeRangeForTransitions(DateTimeZone $time_zone){
34
+    private static function calculateTimeRangeForTransitions(DateTimeZone $time_zone) {
35 35
 
36 36
         $now           = new  DateTime('now', $time_zone);
37 37
         $year          = $now->format('Y');
38
-        return [new DateTime('1/1/'.$year, $time_zone),  new DateTime('1/1/'.($year + 1), $time_zone)];
38
+        return [new DateTime('1/1/'.$year, $time_zone), new DateTime('1/1/'.($year + 1), $time_zone)];
39 39
     }
40 40
 
41 41
     /**
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
      * @param int $former_offset
44 44
      * @return DateTime
45 45
      */
46
-    private static function convertStartDateFromUTC2Local(array $trans, $former_offset){
46
+    private static function convertStartDateFromUTC2Local(array $trans, $former_offset) {
47 47
         $dt     = new DateTime($trans['time'], new DateTimeZone('UTC'));
48 48
         $hours  = abs($former_offset);
49 49
         // START TIME IS ON UTC and should be converted to local using former offset
50
-        if($former_offset >= 0 )
50
+        if ($former_offset >= 0)
51 51
             $dt->add(new DateInterval("PT{$hours}H"));
52 52
         else
53 53
             $dt->sub(new DateInterval("PT{$hours}H"));
@@ -59,12 +59,11 @@  discard block
 block discarded – undo
59 59
      * @param DateTime $dt
60 60
      * @return RecurrenceRule
61 61
      */
62
-    private static function calculateRecurrenceRule(DateTime $dt){
63
-        $r_rule        = new RecurrenceRule();
62
+    private static function calculateRecurrenceRule(DateTime $dt) {
63
+        $r_rule = new RecurrenceRule();
64 64
         $r_rule->setFreq(RecurrenceRule::FREQ_YEARLY);
65 65
         $r_rule->setByMonth(intval($dt->format('m')));
66
-        $r_rule->setByDay
67
-        (
66
+        $r_rule->setByDay(
68 67
             self::translate2ByDay($dt)
69 68
         );
70 69
         return $r_rule;
@@ -74,7 +73,7 @@  discard block
 block discarded – undo
74 73
      * @param $offset
75 74
      * @return string
76 75
      */
77
-    private static function calculateOffsetFrom($offset){
76
+    private static function calculateOffsetFrom($offset) {
78 77
         return sprintf('%s%02d%02d', $offset >= 0 ? '+' : '-', abs($offset), abs(($offset - floor($offset)) * 60));
79 78
     }
80 79
 
@@ -82,7 +81,7 @@  discard block
 block discarded – undo
82 81
      * @param  $offset
83 82
      * @return string
84 83
      */
85
-    private static function calculateOffsetTo($offset){
84
+    private static function calculateOffsetTo($offset) {
86 85
         return sprintf('%s%02d%02d', $offset >= 0 ? '+' : '-', abs($offset), abs(($offset - floor($offset)) * 60));
87 86
     }
88 87
     /**
@@ -91,7 +90,7 @@  discard block
 block discarded – undo
91 90
      * @param bool $with_calendar_envelope
92 91
      * @return Calendar|Timezone
93 92
      */
94
-    public static function build(DateTimeZone $time_zone, $calendar_prod_id, $with_calendar_envelope = true){
93
+    public static function build(DateTimeZone $time_zone, $calendar_prod_id, $with_calendar_envelope = true) {
95 94
 
96 95
         // get all transitions for one current year and next
97 96
         list($start_range, $end_range) = self::calculateTimeRangeForTransitions($time_zone);
@@ -111,11 +110,11 @@  discard block
 block discarded – undo
111 110
 
112 111
             // daylight saving time definition
113 112
             if ($trans['isdst']) {
114
-                $current_time_zone_rule = new TimezoneRule(TimezoneRule::TYPE_DAYLIGHT);;
113
+                $current_time_zone_rule = new TimezoneRule(TimezoneRule::TYPE_DAYLIGHT); ;
115 114
             }
116 115
             // standard time definition
117 116
             else {
118
-                $current_time_zone_rule = new TimezoneRule(TimezoneRule::TYPE_STANDARD);;
117
+                $current_time_zone_rule = new TimezoneRule(TimezoneRule::TYPE_STANDARD); ;
119 118
             }
120 119
 
121 120
             if ($current_time_zone_rule) {
@@ -136,7 +135,7 @@  discard block
 block discarded – undo
136 135
             }
137 136
 
138 137
         }
139
-        if($with_calendar_envelope) {
138
+        if ($with_calendar_envelope) {
140 139
             $vCalendar = new Calendar(sprintf("'-//%s//EN'", $calendar_prod_id));
141 140
             $vCalendar->setTimezone($vTimezone);
142 141
             return $vCalendar;
@@ -156,25 +155,25 @@  discard block
 block discarded – undo
156 155
      * @param DateTime $dt)
157 156
      * @return string
158 157
      */
159
-    private static function translate2ByDay(DateTime $dt){
160
-        $day_name = substr(strtoupper($dt->format('D')), 0,2);
158
+    private static function translate2ByDay(DateTime $dt) {
159
+        $day_name = substr(strtoupper($dt->format('D')), 0, 2);
161 160
         $ordinals = ['first', 'second', 'third', 'fourth', 'last'];
162 161
         $day_nbr  = 0;
163 162
         $is_last  = false;
164 163
 
165
-        foreach($ordinals as $idx => $ord){
164
+        foreach ($ordinals as $idx => $ord) {
166 165
             $dt_n = self::buildOrdinalDateTime($ord, $dt);
167
-            if($dt_n->format('Y-m-d') == $dt->format('Y-m-d')){
168
-                $day_nbr = $idx  + 1;
169
-                if($ord == 'last'){
166
+            if ($dt_n->format('Y-m-d') == $dt->format('Y-m-d')) {
167
+                $day_nbr = $idx + 1;
168
+                if ($ord == 'last') {
170 169
                     $is_last = true;
171
-                    $day_nbr  = 1;
170
+                    $day_nbr = 1;
172 171
                 }
173 172
                 break;
174 173
             }
175 174
         }
176 175
 
177
-        return sprintf('%s%s%s', $is_last? '-':'', $day_nbr, $day_name);
176
+        return sprintf('%s%s%s', $is_last ? '-' : '', $day_nbr, $day_name);
178 177
     }
179 178
 
180 179
     /**
@@ -182,15 +181,11 @@  discard block
 block discarded – undo
182 181
      * @param DateTime $dt
183 182
      * @return DateTime
184 183
      */
185
-    private static function buildOrdinalDateTime($ord, DateTime $dt){
186
-        return new DateTime
187
-        (
188
-            date
189
-            ("Y-m-d",
190
-                strtotime
191
-                (
192
-                    sprintf
193
-                    (
184
+    private static function buildOrdinalDateTime($ord, DateTime $dt) {
185
+        return new DateTime(
186
+            date("Y-m-d",
187
+                strtotime(
188
+                    sprintf(
194 189
                         self::GetOrdinalDayQuery,
195 190
                         $ord,
196 191
                         $dt->format('l'),
Please login to merge, or discard this patch.
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,10 +47,11 @@
 block discarded – undo
47 47
         $dt     = new DateTime($trans['time'], new DateTimeZone('UTC'));
48 48
         $hours  = abs($former_offset);
49 49
         // START TIME IS ON UTC and should be converted to local using former offset
50
-        if($former_offset >= 0 )
51
-            $dt->add(new DateInterval("PT{$hours}H"));
52
-        else
53
-            $dt->sub(new DateInterval("PT{$hours}H"));
50
+        if($former_offset >= 0 ) {
51
+                    $dt->add(new DateInterval("PT{$hours}H"));
52
+        } else {
53
+                    $dt->sub(new DateInterval("PT{$hours}H"));
54
+        }
54 55
 
55 56
         return $dt;
56 57
     }
Please login to merge, or discard this patch.