Passed
Pull Request — master (#2)
by tsms
01:36
created
src/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.
src/Util/Uri.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      *
99 99
      * @access public
100 100
      */
101
-    function __construct($y, $m=null, $d=null, $h=null, $i=null, $s=null)
101
+    function __construct($y, $m = null, $d = null, $h = null, $i = null, $s = null)
102 102
     {
103 103
         $this->setFragments($y, $m, $d, $h, $i, $s);
104 104
     }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      * @return void
117 117
      * @access public
118 118
      */
119
-    function setFragments($y, $m=null, $d=null, $h=null, $i=null, $s=null) 
119
+    function setFragments($y, $m = null, $d = null, $h = null, $i = null, $s = null) 
120 120
     {
121 121
         if (!is_null($y)) $this->uris['Year']   = $y;
122 122
         if (!is_null($m)) $this->uris['Month']  = $m;
Please login to merge, or discard this patch.
src/Decorator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
      * @return void
241 241
      * @access private
242 242
      */
243
-    function setEmpty ($state = true)
243
+    function setEmpty($state = true)
244 244
     {
245 245
         if (method_exists($this->calendar, 'setEmpty')) {
246 246
             $this->calendar->setEmpty($state);
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
       */
436 436
     function prevWeek($format = 'n_in_month')
437 437
     {
438
-        if ( method_exists($this->calendar, 'prevWeek')) {
438
+        if (method_exists($this->calendar, 'prevWeek')) {
439 439
             return $this->calendar->prevWeek($format);
440 440
         } else {
441 441
             include_once 'PEAR.php';
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
      */
458 458
     function thisWeek($format = 'n_in_month')
459 459
     {
460
-        if ( method_exists($this->calendar, 'thisWeek')) {
460
+        if (method_exists($this->calendar, 'thisWeek')) {
461 461
             return $this->calendar->thisWeek($format);
462 462
         } else {
463 463
             include_once 'PEAR.php';
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
      */
480 480
     function nextWeek($format = 'n_in_month')
481 481
     {
482
-        if ( method_exists($this->calendar, 'nextWeek')) {
482
+        if (method_exists($this->calendar, 'nextWeek')) {
483 483
             return $this->calendar->nextWeek($format);
484 484
         } else {
485 485
             include_once 'PEAR.php';
Please login to merge, or discard this patch.
src/Month/Weekdays.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      *
114 114
      * @access public
115 115
      */
116
-    function __construct($y, $m, $firstDay=null)
116
+    function __construct($y, $m, $firstDay = null)
117 117
     {
118 118
         parent::__construct($y, $m, $firstDay);
119 119
     }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     function buildEmptyDaysBefore()
152 152
     {
153 153
         $eBefore = $this->tableHelper->getEmptyDaysBefore();
154
-        for ($i=0; $i < $eBefore; $i++) {
154
+        for ($i = 0; $i < $eBefore; $i++) {
155 155
             $stamp = $this->cE->dateToStamp($this->year, $this->month, -$i);
156 156
             $Day = new Day(
157 157
                                 $this->cE->stampToYear($stamp),
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
     {
188 188
         $eAfter = $this->tableHelper->getEmptyDaysAfter();
189 189
         $sDOM   = $this->tableHelper->getNumTableDaysInMonth();
190
-        for ($i=1; $i <= $sDOM-$eAfter; $i++) {
191
-            $Day = new Day($this->year, $this->month+1, $i);
190
+        for ($i = 1; $i <= $sDOM - $eAfter; $i++) {
191
+            $Day = new Day($this->year, $this->month + 1, $i);
192 192
             $Day->setEmpty();
193 193
             $Day->adjust();
194 194
             array_push($this->children, $Day);
@@ -210,9 +210,9 @@  discard block
 block discarded – undo
210 210
             $this->thisDay()
211 211
         );
212 212
         $sDOM = $this->tableHelper->getNumTableDaysInMonth();
213
-        for ($i=1; $i <= $sDOM; $i+= $dIW) {
213
+        for ($i = 1; $i <= $sDOM; $i += $dIW) {
214 214
             $this->children[$i]->setFirst();
215
-            $this->children[$i+($dIW-1)]->setLast();
215
+            $this->children[$i + ($dIW - 1)]->setLast();
216 216
         }
217 217
     }
218 218
 }
Please login to merge, or discard this patch.
src/Month/Weeks.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
      *
106 106
      * @access public
107 107
      */
108
-    function __construct($y, $m, $firstDay=null)
108
+    function __construct($y, $m, $firstDay = null)
109 109
     {
110 110
         parent::__construct($y, $m, $firstDay);
111 111
     }
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
         $this->tableHelper = new Helper($this, $this->firstDay);
125 125
         include_once CALENDAR_ROOT.'Week.php';
126 126
         $numWeeks = $this->tableHelper->getNumWeeks();
127
-        for ($i=1, $d=1; $i<=$numWeeks; $i++,
128
-            $d+=$this->cE->getDaysInWeek(
127
+        for ($i = 1, $d = 1; $i <= $numWeeks; $i++,
128
+            $d += $this->cE->getDaysInWeek(
129 129
                 $this->thisYear(),
130 130
                 $this->thisMonth(),
131 131
                 $this->thisDay()
Please login to merge, or discard this patch.
src/Day.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         include_once CALENDAR_ROOT.'Hour.php';
120 120
 
121 121
         $hID = $this->cE->getHoursInDay($this->year, $this->month, $this->day);
122
-        for ($i=0; $i < $hID; $i++) {
122
+        for ($i = 0; $i < $hID; $i++) {
123 123
             $this->children[$i] =
124 124
                 new Hour($this->year, $this->month, $this->day, $i);
125 125
         }
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
      * @return void
215 215
      * @access private
216 216
      */
217
-    function setEmpty ($state = true)
217
+    function setEmpty($state = true)
218 218
     {
219 219
         $this->empty = $state;
220 220
     }
Please login to merge, or discard this patch.
src/Calendar.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
 /**
55 55
  * Define Calendar Month states
56 56
  */
57
-define('CALENDAR_USE_MONTH',          1);
57
+define('CALENDAR_USE_MONTH', 1);
58 58
 define('CALENDAR_USE_MONTH_WEEKDAYS', 2);
59
-define('CALENDAR_USE_MONTH_WEEKS',    3);
59
+define('CALENDAR_USE_MONTH_WEEKS', 3);
60 60
 
61 61
 /**
62 62
  * Contains a factory method to return a Singleton instance of a class
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
      * @return array
312 312
      * @access public
313 313
      */
314
-    function toArray($stamp=null)
314
+    function toArray($stamp = null)
315 315
     {
316 316
         if (is_null($stamp)) {
317 317
             $stamp = $this->getTimeStamp();
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
                 $this->thisDay()
504 504
             );
505 505
         }
506
-        define ('CALENDAR_FIRST_DAY_OF_WEEK', $firstDay);
506
+        define('CALENDAR_FIRST_DAY_OF_WEEK', $firstDay);
507 507
         return CALENDAR_FIRST_DAY_OF_WEEK;
508 508
     }
509 509
 
@@ -517,8 +517,8 @@  discard block
 block discarded – undo
517 517
      */
518 518
     function prevYear($format = 'int')
519 519
     {
520
-        $ts = $this->cE->dateToStamp($this->year-1, 1, 1, 0, 0, 0);
521
-        return $this->returnValue('Year', $format, $ts, $this->year-1);
520
+        $ts = $this->cE->dateToStamp($this->year - 1, 1, 1, 0, 0, 0);
521
+        return $this->returnValue('Year', $format, $ts, $this->year - 1);
522 522
     }
523 523
 
524 524
     /**
@@ -545,8 +545,8 @@  discard block
 block discarded – undo
545 545
      */
546 546
     function nextYear($format = 'int')
547 547
     {
548
-        $ts = $this->cE->dateToStamp($this->year+1, 1, 1, 0, 0, 0);
549
-        return $this->returnValue('Year', $format, $ts, $this->year+1);
548
+        $ts = $this->cE->dateToStamp($this->year + 1, 1, 1, 0, 0, 0);
549
+        return $this->returnValue('Year', $format, $ts, $this->year + 1);
550 550
     }
551 551
 
552 552
     /**
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
      */
560 560
     function prevMonth($format = 'int')
561 561
     {
562
-        $ts = $this->cE->dateToStamp($this->year, $this->month-1, 1, 0, 0, 0);
562
+        $ts = $this->cE->dateToStamp($this->year, $this->month - 1, 1, 0, 0, 0);
563 563
         return $this->returnValue('Month', $format, $ts, $this->cE->stampToMonth($ts));
564 564
     }
565 565
 
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
      */
588 588
     function nextMonth($format = 'int')
589 589
     {
590
-        $ts = $this->cE->dateToStamp($this->year, $this->month+1, 1, 0, 0, 0);
590
+        $ts = $this->cE->dateToStamp($this->year, $this->month + 1, 1, 0, 0, 0);
591 591
         return $this->returnValue('Month', $format, $ts, $this->cE->stampToMonth($ts));
592 592
     }
593 593
 
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
     function prevDay($format = 'int')
603 603
     {
604 604
         $ts = $this->cE->dateToStamp(
605
-            $this->year, $this->month, $this->day-1, 0, 0, 0);
605
+            $this->year, $this->month, $this->day - 1, 0, 0, 0);
606 606
         return $this->returnValue('Day', $format, $ts, $this->cE->stampToDay($ts));
607 607
     }
608 608
 
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
     function nextDay($format = 'int')
633 633
     {
634 634
         $ts = $this->cE->dateToStamp(
635
-            $this->year, $this->month, $this->day+1, 0, 0, 0);
635
+            $this->year, $this->month, $this->day + 1, 0, 0, 0);
636 636
         return $this->returnValue('Day', $format, $ts, $this->cE->stampToDay($ts));
637 637
     }
638 638
 
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
     function prevHour($format = 'int')
648 648
     {
649 649
         $ts = $this->cE->dateToStamp(
650
-            $this->year, $this->month, $this->day, $this->hour-1, 0, 0);
650
+            $this->year, $this->month, $this->day, $this->hour - 1, 0, 0);
651 651
         return $this->returnValue('Hour', $format, $ts, $this->cE->stampToHour($ts));
652 652
     }
653 653
 
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
     function nextHour($format = 'int')
678 678
     {
679 679
         $ts = $this->cE->dateToStamp(
680
-            $this->year, $this->month, $this->day, $this->hour+1, 0, 0);
680
+            $this->year, $this->month, $this->day, $this->hour + 1, 0, 0);
681 681
         return $this->returnValue('Hour', $format, $ts, $this->cE->stampToHour($ts));
682 682
     }
683 683
 
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
     {
694 694
         $ts = $this->cE->dateToStamp(
695 695
             $this->year, $this->month, $this->day,
696
-            $this->hour, $this->minute-1, 0);
696
+            $this->hour, $this->minute - 1, 0);
697 697
         return $this->returnValue('Minute', $format, $ts, $this->cE->stampToMinute($ts));
698 698
     }
699 699
 
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
     {
726 726
         $ts = $this->cE->dateToStamp(
727 727
             $this->year, $this->month, $this->day,
728
-            $this->hour, $this->minute+1, 0);
728
+            $this->hour, $this->minute + 1, 0);
729 729
         return $this->returnValue('Minute', $format, $ts, $this->cE->stampToMinute($ts));
730 730
     }
731 731
 
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
     {
742 742
         $ts = $this->cE->dateToStamp(
743 743
             $this->year, $this->month, $this->day,
744
-            $this->hour, $this->minute, $this->second-1);
744
+            $this->hour, $this->minute, $this->second - 1);
745 745
         return $this->returnValue('Second', $format, $ts, $this->cE->stampToSecond($ts));
746 746
     }
747 747
 
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
     {
774 774
         $ts = $this->cE->dateToStamp(
775 775
             $this->year, $this->month, $this->day,
776
-            $this->hour, $this->minute, $this->second+1);
776
+            $this->hour, $this->minute, $this->second + 1);
777 777
         return $this->returnValue('Second', $format, $ts, $this->cE->stampToSecond($ts));
778 778
     }
779 779
 }
Please login to merge, or discard this patch.
src/Year.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
         include_once CALENDAR_ROOT.'Factory.php';
109 109
         $this->firstDay = $this->defineFirstDayOfWeek($firstDay);
110 110
         $monthsInYear   = $this->cE->getMonthsInYear($this->thisYear());
111
-        for ($i=1; $i <= $monthsInYear; $i++) {
111
+        for ($i = 1; $i <= $monthsInYear; $i++) {
112 112
             $this->children[$i] = Factory::create('Month', $this->year, $i);
113 113
         }
114 114
         if (count($sDates) > 0) {
Please login to merge, or discard this patch.
src/ValidationError.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@
 block discarded – undo
137 137
      * @return string
138 138
      * @access public
139 139
      */
140
-    function toString ()
140
+    function toString()
141 141
     {
142 142
         return $this->unit.' = '.$this->value.' ['.$this->message.']';
143 143
     }
Please login to merge, or discard this patch.