Passed
Pull Request — master (#2)
by tsms
01:37
created
Calendar/Calendar.php 1 patch
Switch Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -88,13 +88,13 @@  discard block
 block discarded – undo
88 88
     {
89 89
         static $engine = false;
90 90
         switch (CALENDAR_ENGINE) {
91
-        case 'PearDate':
92
-            $class = 'Calendar_Engine_PearDate';
93
-            break;
94
-        case 'UnixTS':
95
-        default:
96
-            $class = 'Pear\Calendar\Engine\UnixTS';
97
-            break;
91
+            case 'PearDate':
92
+                $class = 'Calendar_Engine_PearDate';
93
+                break;
94
+            case 'UnixTS':
95
+            default:
96
+                $class = 'Pear\Calendar\Engine\UnixTS';
97
+                break;
98 98
         }
99 99
         if (!$engine) {
100 100
             if (!class_exists($class)) {
@@ -341,19 +341,19 @@  discard block
 block discarded – undo
341 341
     function returnValue($returnType, $format, $stamp, $default)
342 342
     {
343 343
         switch (strtolower($format)) {
344
-        case 'int':
345
-            return $default;
346
-        case 'array':
347
-            return $this->toArray($stamp);
348
-            break;
349
-        case 'object':
350
-            include_once CALENDAR_ROOT.'Factory.php';
351
-            return Factory::createByTimestamp($returnType, $stamp);
352
-            break;
353
-        case 'timestamp':
354
-        default:
355
-            return $stamp;
356
-            break;
344
+            case 'int':
345
+                return $default;
346
+            case 'array':
347
+                return $this->toArray($stamp);
348
+                break;
349
+            case 'object':
350
+                include_once CALENDAR_ROOT.'Factory.php';
351
+                return Factory::createByTimestamp($returnType, $stamp);
352
+                break;
353
+            case 'timestamp':
354
+            default:
355
+                return $stamp;
356
+                break;
357 357
         }
358 358
     }
359 359
 
Please login to merge, or discard this patch.
Calendar/Util/Textual.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -80,10 +80,10 @@  discard block
 block discarded – undo
80 80
             $format = 'long';
81 81
         }
82 82
         $months = array();
83
-        for ($i=1; $i<=12; $i++) {
83
+        for ($i = 1; $i <= 12; $i++) {
84 84
             $stamp = mktime(0, 0, 0, $i, 1, 2003);
85 85
             $month = strftime($formats[$format], $stamp);
86
-            switch($format) {
86
+            switch ($format) {
87 87
             case 'one':
88 88
                 $month = substr($month, 0, 1);
89 89
                 break;
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
             $format = 'long';
118 118
         }
119 119
         $days = array();
120
-        for ($i=0; $i<=6; $i++) {
121
-            $stamp = mktime(0, 0, 0, 11, $i+2, 2003);
120
+        for ($i = 0; $i <= 6; $i++) {
121
+            $stamp = mktime(0, 0, 0, 11, $i + 2, 2003);
122 122
             $day = strftime($formats[$format], $stamp);
123
-            switch($format) {
123
+            switch ($format) {
124 124
             case 'one':
125 125
                 $day = substr($day, 0, 1);
126 126
                 break;
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
      * @access public
213 213
      * @static
214 214
      */
215
-    function thisDayName($Calendar, $format='long')
215
+    function thisDayName($Calendar, $format = 'long')
216 216
     {
217 217
         $days = Textual::weekdayNames($format);
218 218
         $stamp = $Calendar->thisDay('timestamp');
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
      * @access public
232 232
      * @static
233 233
      */
234
-    function nextDayName($Calendar, $format='long')
234
+    function nextDayName($Calendar, $format = 'long')
235 235
     {
236 236
         $days = Textual::weekdayNames($format);
237 237
         $stamp = $Calendar->nextDay('timestamp');
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
             //check if defined / set
265 265
             if (defined('CALENDAR_FIRST_DAY_OF_WEEK')) {
266 266
                 $firstDay = CALENDAR_FIRST_DAY_OF_WEEK;
267
-            } elseif(isset($Calendar->firstDay)) {
267
+            } elseif (isset($Calendar->firstDay)) {
268 268
                 $firstDay = $Calendar->firstDay;
269 269
             }
270 270
             $ordereddays = array();
Please login to merge, or discard this patch.
Calendar/Engine/PearDate.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
      * @return string iso-8601 datetime
168 168
      * @access protected
169 169
      */
170
-    function dateToStamp($y, $m, $d, $h=0, $i=0, $s=0)
170
+    function dateToStamp($y, $m, $d, $h = 0, $i = 0, $s = 0)
171 171
     {
172 172
         $r = array();
173 173
         PearDate::adjustDate($y, $m, $d, $h, $i, $s);
@@ -218,8 +218,8 @@  discard block
 block discarded – undo
218 218
             $d += floor($h / 24);
219 219
             $h %= 24;
220 220
         }
221
-        for(; $m < 1; $y--, $m+=12);
222
-        for(; $m > 12; $y++, $m-=12);
221
+        for (; $m < 1; $y--, $m += 12);
222
+        for (; $m > 12; $y++, $m -= 12);
223 223
 
224 224
         while ($d < 1) {
225 225
             if ($m > 1) {
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
             }
231 231
             $d += Date_Calc::daysInMonth($m, $y);
232 232
         }
233
-        for ($max_days = Date_Calc::daysInMonth($m, $y); $d > $max_days; ) {
233
+        for ($max_days = Date_Calc::daysInMonth($m, $y); $d > $max_days;) {
234 234
             $d -= $max_days;
235 235
             if ($m < 12) {
236 236
                 $m++;
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
      * @return int (12)
272 272
      * @access protected
273 273
      */
274
-    function getMonthsInYear($y=null)
274
+    function getMonthsInYear($y = null)
275 275
     {
276 276
         return 12;
277 277
     }
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
      * @return int (7)
316 316
      * @access protected
317 317
      */
318
-    function getDaysInWeek($y=null, $m=null, $d=null)
318
+    function getDaysInWeek($y = null, $m = null, $d = null)
319 319
     {
320 320
         return 7;
321 321
     }
@@ -348,9 +348,9 @@  discard block
 block discarded – undo
348 348
      * @return int week number
349 349
      * @access protected
350 350
      */
351
-    function getWeekNInMonth($y, $m, $d, $firstDay=1)
351
+    function getWeekNInMonth($y, $m, $d, $firstDay = 1)
352 352
     {
353
-        $weekEnd = ($firstDay == 0) ? $this->getDaysInWeek()-1 : $firstDay-1;
353
+        $weekEnd = ($firstDay == 0) ? $this->getDaysInWeek() - 1 : $firstDay - 1;
354 354
         $end_of_week = (int)Date_Calc::nextDayOfWeek($weekEnd, 1, $m, $y, '%e', true);
355 355
         $w = 1;
356 356
         while ($d > $end_of_week) {
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
      * @return int weeks number
371 371
      * @access protected
372 372
      */
373
-    function getWeeksInMonth($y, $m, $firstDay=1)
373
+    function getWeeksInMonth($y, $m, $firstDay = 1)
374 374
     {
375 375
         $FDOM = Date_Calc::firstOfMonthWeekday($m, $y);
376 376
         if ($FDOM == 0) {
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
      * @return array (0, 1, 2, 3, 4, 5, 6) 1 = Monday
414 414
      * @access protected
415 415
      */
416
-    function getWeekDays($y=null, $m=null, $d=null)
416
+    function getWeekDays($y = null, $m = null, $d = null)
417 417
     {
418 418
         return array(0, 1, 2, 3, 4, 5, 6);
419 419
     }
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
      * @return int (default 1 = Monday)
429 429
      * @access protected
430 430
      */
431
-    function getFirstDayOfWeek($y=null, $m=null, $d=null)
431
+    function getFirstDayOfWeek($y = null, $m = null, $d = null)
432 432
     {
433 433
         return 1;
434 434
     }
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
      * @return int (24)
444 444
      * @access protected
445 445
      */
446
-    function getHoursInDay($y=null,$m=null,$d=null)
446
+    function getHoursInDay($y = null, $m = null, $d = null)
447 447
     {
448 448
         return 24;
449 449
     }
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
      * @return int (60)
460 460
      * @access protected
461 461
      */
462
-    function getMinutesInHour($y=null,$m=null,$d=null,$h=null)
462
+    function getMinutesInHour($y = null, $m = null, $d = null, $h = null)
463 463
     {
464 464
         return 60;
465 465
     }
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
      * @return int (60)
477 477
      * @access protected
478 478
      */
479
-    function getSecondsInMinute($y=null,$m=null,$d=null,$h=null,$i=null)
479
+    function getSecondsInMinute($y = null, $m = null, $d = null, $h = null, $i = null)
480 480
     {
481 481
         return 60;
482 482
     }
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
             $today = new Date();
497 497
         }
498 498
         $date = PearDate::stampCollection($stamp);
499
-        return (   $date->day == $today->getDay()
499
+        return ($date->day == $today->getDay()
500 500
                 && $date->month == $today->getMonth()
501 501
                 && $date->year == $today->getYear()
502 502
         );
Please login to merge, or discard this patch.