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 ( 869ff2...919b18 )
by Adrian
11s
created
src/Store/SqlLiteDBStore.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,8 +108,7 @@
 block discarded – undo
108 108
             $command = rtrim($command, ',');
109 109
             $command .= " WHERE unit_id = " . $event->getUnitId() . " AND year = $year AND month = $month";
110 110
             $this->pdo->exec($command);
111
-          }
112
-          else {
111
+          } else {
113 112
             $this->pdo->exec("INSERT INTO $this->day_table (unit_id, year, month, " . implode(', ', $keys) . ") VALUES (" . $event->getUnitId() . ", $year, $month, " . implode(', ', $values) . ")");
114 113
           }
115 114
         }
Please login to merge, or discard this patch.
src/Constraint/ConstraintManager.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -115,12 +115,10 @@  discard block
 block discarded – undo
115 115
             if ($start_date >= $new_start_date && $start_date <= $new_end_date) {
116 116
               $new_end_date_clone = clone($new_end_date);
117 117
               $constraint->setStartDate($new_end_date_clone->add(new \DateInterval('P1D')));
118
-            }
119
-            elseif ($end_date >= $new_start_date && $end_date <= $new_end_date) {
118
+            } elseif ($end_date >= $new_start_date && $end_date <= $new_end_date) {
120 119
               $new_start_date_clone = clone($new_start_date);
121 120
               $constraint->setEndDate($new_start_date_clone->sub(new \DateInterval('P1D')));
122
-            }
123
-            elseif ($start_date < $new_start_date && $end_date > $new_end_date) {
121
+            } elseif ($start_date < $new_start_date && $end_date > $new_end_date) {
124 122
               if ($constraint->getEndDate() > $new_start_date) {
125 123
                 $new_start_date_clone = clone($new_start_date);
126 124
                 $constraint->setEndDate($new_start_date_clone->sub(new \DateInterval('P1D')));
@@ -132,8 +130,7 @@  discard block
 block discarded – undo
132 130
                 $split_end_date = $end_date;
133 131
 
134 132
                 $split_constraint = new MinMaxDaysConstraint($constraint->getUnits(), $constraint->getMinDays(), $constraint->getMaxDays(), $split_start_date, $split_end_date, $constraint->getCheckinDay());
135
-              }
136
-              else {
133
+              } else {
137 134
                 $split_start_date = $split_constraint->getStartDate();
138 135
                 $split_end_date = $split_constraint->getEndDate();
139 136
 
Please login to merge, or discard this patch.
src/Calendar/AbstractCalendar.php 1 patch
Braces   +18 added lines, -26 removed lines patch added patch discarded remove patch
@@ -146,8 +146,7 @@  discard block
 block discarded – undo
146 146
       // Compare the current states with the set of valid states
147 147
       if ($intersect) {
148 148
         $remaining_states = array_intersect($current_states, $valid_states);
149
-      }
150
-      else {
149
+      } else {
151 150
         $remaining_states = array_diff($current_states, $valid_states);
152 151
       }
153 152
 
@@ -155,8 +154,7 @@  discard block
 block discarded – undo
155 154
         // Unit is in a state that is within the set of valid states so add to result set
156 155
         $units[$unit] = $unit;
157 156
         $response->addMatch($keyed_units[$unit], CalendarResponse::VALID_STATE);
158
-      }
159
-      else {
157
+      } else {
160 158
         $response->addMiss($keyed_units[$unit], CalendarResponse::INVALID_STATE);
161 159
       }
162 160
 
@@ -250,8 +248,7 @@  discard block
 block discarded – undo
250 248
           foreach ($days as $day => $value) {
251 249
             $result[$year][$month][$day] = ((int)$db_events[$unit][Event::BAT_DAY][$year][$month][$day] == 0 ? $keyed_units[$unit]->getDefaultValue() : (int)$db_events[$unit][Event::BAT_DAY][$year][$month][$day]);
252 250
           }
253
-        }
254
-        else {
251
+        } else {
255 252
           foreach ($days as $day => $value) {
256 253
             $result[$year][$month][$day] = $keyed_units[$unit]->getDefaultValue();
257 254
           }
@@ -282,8 +279,7 @@  discard block
 block discarded – undo
282 279
             foreach ($hours as $hour => $value) {
283 280
               if (isset($db_events[$unit][Event::BAT_HOUR][$year][$month][$day][$hour])) {
284 281
                 $result[$year][$month][$day][$hour] = ((int) $db_events[$unit][Event::BAT_HOUR][$year][$month][$day][$hour] == 0 ? $keyed_units[$unit]->getDefaultValue() : (int) $db_events[$unit][Event::BAT_HOUR][$year][$month][$day][$hour]);
285
-              }
286
-              else {
282
+              } else {
287 283
                 // If nothing from db - then revert to the defaults
288 284
                 $result[$year][$month][$day][$hour] = (int) $keyed_units[$unit]->getDefaultValue();
289 285
               }
@@ -331,8 +327,7 @@  discard block
 block discarded – undo
331 327
               foreach ($minutes as $minute => $value) {
332 328
                 if (isset($db_events[$unit][Event::BAT_MINUTE][$year][$month][$day][$hour][$minute])) {
333 329
                   $result[$year][$month][$day][$hour][$minute] = ((int) $db_events[$unit][Event::BAT_MINUTE][$year][$month][$day][$hour][$minute] == 0 ? $keyed_units[$unit]->getDefaultValue() : (int) $db_events[$unit][Event::BAT_MINUTE][$year][$month][$day][$hour][$minute]);
334
-                }
335
-                else {
330
+                } else {
336 331
                   // If nothing from db - then revert to the defaults
337 332
                   $result[$year][$month][$day][$hour][$minute] = (int) $keyed_units[$unit]->getDefaultValue();
338 333
                 }
@@ -393,8 +388,12 @@  discard block
 block discarded – undo
393 388
 
394 389
       // Make sure years are sorted
395 390
       ksort($data[Event::BAT_DAY]);
396
-      if (isset($data[Event::BAT_HOUR])) ksort($data[Event::BAT_HOUR]);
397
-      if (isset($data[Event::BAT_MINUTE])) ksort($data[Event::BAT_MINUTE]);
391
+      if (isset($data[Event::BAT_HOUR])) {
392
+        ksort($data[Event::BAT_HOUR]);
393
+      }
394
+      if (isset($data[Event::BAT_MINUTE])) {
395
+        ksort($data[Event::BAT_MINUTE]);
396
+      }
398 397
 
399 398
       // Set up variables to keep track of stuff
400 399
       $current_value = NULL;
@@ -419,8 +418,7 @@  discard block
 block discarded – undo
419 418
                     if ($current_value === $minute_value) {
420 419
                       // We are still in minutes and going through so add a minute
421 420
                       $end_event->add(new \DateInterval('PT1M'));
422
-                    }
423
-                    elseif (($current_value != $minute_value) && ($current_value !== NULL)) {
421
+                    } elseif (($current_value != $minute_value) && ($current_value !== NULL)) {
424 422
                       // Value just switched - let us wrap up with current event and start a new one
425 423
                       $normalized_events[$unit_id][] = new Event($start_event, $end_event, $this->getUnit($unit_id), $current_value);
426 424
                       $start_event = clone($end_event->add(new \DateInterval('PT1M')));
@@ -434,12 +432,10 @@  discard block
 block discarded – undo
434 432
                     }
435 433
                     $current_value = $minute_value;
436 434
                   }
437
-                }
438
-                elseif ($current_value === $hour_value) {
435
+                } elseif ($current_value === $hour_value) {
439 436
                   // We are in hours and can add something
440 437
                   $end_event->add(new \DateInterval('PT1H'));
441
-                }
442
-                elseif (($current_value != $hour_value) && ($current_value !== NULL)) {
438
+                } elseif (($current_value != $hour_value) && ($current_value !== NULL)) {
443 439
                   $skip_finalize_event = FALSE;
444 440
 
445 441
                   if ($is_daylight_saving_time) {
@@ -466,12 +462,10 @@  discard block
 block discarded – undo
466 462
                   $current_value = $hour_value;
467 463
                 }
468 464
               }
469
-            }
470
-            elseif ($current_value === $value) {
465
+            } elseif ($current_value === $value) {
471 466
               // We are adding a whole day so the end event gets moved to the end of the day we are adding
472 467
               $end_event = new \DateTime($year . '-' . $month . '-' . substr($day, 1) . ' ' . '23:59');
473
-            }
474
-            elseif (($current_value !== $value) && ($current_value !== NULL)) {
468
+            } elseif (($current_value !== $value) && ($current_value !== NULL)) {
475 469
               // Value just switched - let us wrap up with current event and start a new one
476 470
               $normalized_events[$unit_id][] = new Event($start_event, $end_event, $this->getUnit($unit_id), $current_value);
477 471
               // Start event becomes the end event with a minute added
@@ -506,8 +500,7 @@  discard block
 block discarded – undo
506 500
           if ($event->endsLater($end_date)) {
507 501
             $event->setEndDate($end_date);
508 502
           }
509
-        }
510
-        else {
503
+        } else {
511 504
           // Event completely not in range so unset it
512 505
           unset($normalized_events[$unit_id][$key]);
513 506
         }
@@ -538,8 +531,7 @@  discard block
 block discarded – undo
538 531
           $e++;
539 532
           $flipped[$e][$value][$datum] = $datum;
540 533
           $old_value = $value;
541
-        }
542
-        else {
534
+        } else {
543 535
           $flipped[$e][$value][$datum] = $datum;
544 536
         }
545 537
       }
Please login to merge, or discard this patch.
src/Event/EventItemizer.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -129,8 +129,7 @@  discard block
 block discarded – undo
129 129
     // We add a minute to compensate
130 130
     elseif (($this->event->getStartDate()->format('Y-m-d H:i') == $this->event->getEndDate()->format('Y-m-d H:i')) && $this->granularity == EventItemizer::BAT_DAILY) {
131 131
       $adjusted_end_day = new \DateTime($this->event->getEndDate()->add(new \DateInterval('PT1M'))->format('Y-m-d H:i'));
132
-    }
133
-    else {
132
+    } else {
134 133
       $adjusted_end_day = new \DateTime($this->event->getEndDate()->format('Y-m-d H:i'));
135 134
     }
136 135
 
@@ -221,16 +220,14 @@  discard block
 block discarded – undo
221 220
         $itemized[EventItemizer::BAT_HOUR][$sy][$sm]['d' . $sd] = $itemized_same_day[EventItemizer::BAT_HOUR][$sy][$sm]['d' . $sd];
222 221
         $itemized[EventItemizer::BAT_MINUTE][$sy][$sm]['d' . $sd] = $itemized_same_day[EventItemizer::BAT_MINUTE][$sy][$sm]['d' . $sd];
223 222
       }
224
-    }
225
-    else {
223
+    } else {
226 224
       // Deal with the start day unless it starts on midnight precisely at which point the whole day is booked
227 225
       if (!($this->event->getStartDate()->format('H:i') == '00:00')) {
228 226
         $itemized_start = $this->createHourlyGranular($start_date, new \DateTime($start_date->format("Y-n-j 23:59:59")), $interval, $start_date);
229 227
         $itemized[EventItemizer::BAT_DAY][$sy][$sm]['d' . $sd] = -1;
230 228
         $itemized[EventItemizer::BAT_HOUR][$sy][$sm]['d' . $sd] = $itemized_start[EventItemizer::BAT_HOUR][$sy][$sm]['d' . $sd];
231 229
         $itemized[EventItemizer::BAT_MINUTE][$sy][$sm]['d' . $sd] = $itemized_start[EventItemizer::BAT_MINUTE][$sy][$sm]['d' . $sd];
232
-      }
233
-      else {
230
+      } else {
234 231
         // Just set an empty hour and minute
235 232
         $itemized[EventItemizer::BAT_HOUR][$sy][$sm]['d' . $sd] = array();
236 233
         $itemized[EventItemizer::BAT_MINUTE][$sy][$sm]['d' . $sd] = array();
@@ -240,8 +237,7 @@  discard block
 block discarded – undo
240 237
       if ($this->event->getEndDate()->format('H:i') == '23:59') {
241 238
         $itemized[EventItemizer::BAT_HOUR][$ey][$em]['d' . $ed] = array();
242 239
         $itemized[EventItemizer::BAT_MINUTE][$ey][$em]['d' . $ed] = array();
243
-      }
244
-      else {
240
+      } else {
245 241
         $itemized_end = $this->createHourlyGranular(new \DateTime($end_date->format("Y-n-j 00:00:00")), $end_date->add(new \DateInterval('PT1M')), $interval, new \DateTime($end_date->format("Y-n-j 00:00:00")));
246 242
         $itemized[EventItemizer::BAT_DAY][$ey][$em]['d' . $ed] = -1;
247 243
         $itemized[EventItemizer::BAT_HOUR][$ey][$em]['d' . $ed] = $itemized_end[EventItemizer::BAT_HOUR][$ey][$em]['d' . $ed];
@@ -294,8 +290,7 @@  discard block
 block discarded – undo
294 290
         $min = 0;
295 291
         $hour++;
296 292
         $start_minute = 0;
297
-      }
298
-      elseif ($min == 60 && $start_minute == 0) {
293
+      } elseif ($min == 60 && $start_minute == 0) {
299 294
         // Did a real whole hour so initialize the hour
300 295
         $itemized[EventItemizer::BAT_HOUR][$year][$month]['d' . $day]['h' . $hour] = $event_value;
301 296
 
Please login to merge, or discard this patch.