@@ -113,7 +113,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -54,9 +54,9 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -137,7 +137,7 @@ |
||
| 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 | } |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | 'Hour', $h, CALENDAR_VALUE_TOOSMALL.$min); |
| 206 | 206 | return false; |
| 207 | 207 | } |
| 208 | - $max = ($this->cE->getHoursInDay($this->calendar->thisDay())-1); |
|
| 208 | + $max = ($this->cE->getHoursInDay($this->calendar->thisDay()) - 1); |
|
| 209 | 209 | if ($h > $max) { |
| 210 | 210 | $this->errors[] = new ValidationError( |
| 211 | 211 | 'Hour', $h, CALENDAR_VALUE_TOOLARGE.$max); |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | 'Minute', $i, CALENDAR_VALUE_TOOSMALL.$min); |
| 230 | 230 | return false; |
| 231 | 231 | } |
| 232 | - $max = ($this->cE->getMinutesInHour($this->calendar->thisHour())-1); |
|
| 232 | + $max = ($this->cE->getMinutesInHour($this->calendar->thisHour()) - 1); |
|
| 233 | 233 | if ($i > $max) { |
| 234 | 234 | $this->errors[] = new ValidationError( |
| 235 | 235 | 'Minute', $i, CALENDAR_VALUE_TOOLARGE.$max); |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | 'Second', $s, CALENDAR_VALUE_TOOSMALL.$min); |
| 254 | 254 | return false; |
| 255 | 255 | } |
| 256 | - $max = ($this->cE->getSecondsInMinute($this->calendar->thisMinute())-1); |
|
| 256 | + $max = ($this->cE->getSecondsInMinute($this->calendar->thisMinute()) - 1); |
|
| 257 | 257 | if ($s > $max) { |
| 258 | 258 | $this->errors[] = new ValidationError( |
| 259 | 259 | 'Second', $s, CALENDAR_VALUE_TOOLARGE.$max); |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | { |
| 85 | 85 | $mIH = $this->cE->getMinutesInHour($this->year, $this->month, $this->day, |
| 86 | 86 | $this->hour); |
| 87 | - for ($i=0; $i < $mIH; $i++) { |
|
| 87 | + for ($i = 0; $i < $mIH; $i++) { |
|
| 88 | 88 | $this->children[$i] = |
| 89 | 89 | new Minute($this->year, $this->month, $this->day, |
| 90 | 90 | $this->hour, $i); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | * |
| 67 | 67 | * @access public |
| 68 | 68 | */ |
| 69 | - function __construct($y, $m, $firstDay=null) |
|
| 69 | + function __construct($y, $m, $firstDay = null) |
|
| 70 | 70 | { |
| 71 | 71 | parent::__construct($y, $m); |
| 72 | 72 | $this->firstDay = $this->defineFirstDayOfWeek($firstDay); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | function build($sDates = array()) |
| 85 | 85 | { |
| 86 | 86 | $daysInMonth = $this->cE->getDaysInMonth($this->year, $this->month); |
| 87 | - for ($i=1; $i<=$daysInMonth; $i++) { |
|
| 87 | + for ($i = 1; $i <= $daysInMonth; $i++) { |
|
| 88 | 88 | $this->children[$i] = new Day($this->year, $this->month, $i); |
| 89 | 89 | } |
| 90 | 90 | if (count($sDates) > 0) { |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | function build($sDates = array()) |
| 112 | 112 | { |
| 113 | 113 | $hID = $this->cE->getHoursInDay($this->year, $this->month, $this->day); |
| 114 | - for ($i=0; $i < $hID; $i++) { |
|
| 114 | + for ($i = 0; $i < $hID; $i++) { |
|
| 115 | 115 | $this->children[$i] = |
| 116 | 116 | new Hour($this->year, $this->month, $this->day, $i); |
| 117 | 117 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | * @return void |
| 207 | 207 | * @access private |
| 208 | 208 | */ |
| 209 | - function setEmpty ($state = true) |
|
| 209 | + function setEmpty($state = true) |
|
| 210 | 210 | { |
| 211 | 211 | $this->empty = $state; |
| 212 | 212 | } |
@@ -85,7 +85,7 @@ |
||
| 85 | 85 | { |
| 86 | 86 | $sIM = $this->cE->getSecondsInMinute($this->year, $this->month, |
| 87 | 87 | $this->day, $this->hour, $this->minute); |
| 88 | - for ($i=0; $i < $sIM; $i++) { |
|
| 88 | + for ($i = 0; $i < $sIM; $i++) { |
|
| 89 | 89 | $this->children[$i] = new Second($this->year, $this->month, |
| 90 | 90 | $this->day, $this->hour, $this->minute, $i); |
| 91 | 91 | } |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | { |
| 94 | 94 | $this->firstDay = $this->defineFirstDayOfWeek($firstDay); |
| 95 | 95 | $monthsInYear = $this->cE->getMonthsInYear($this->thisYear()); |
| 96 | - for ($i=1; $i <= $monthsInYear; $i++) { |
|
| 96 | + for ($i = 1; $i <= $monthsInYear; $i++) { |
|
| 97 | 97 | $this->children[$i] = Factory::create('Month', $this->year, $i); |
| 98 | 98 | } |
| 99 | 99 | if (count($sDates) > 0) { |