@@ -96,41 +96,41 @@ |
||
| 96 | 96 | { |
| 97 | 97 | $firstDay = defined('CALENDAR_FIRST_DAY_OF_WEEK') ? CALENDAR_FIRST_DAY_OF_WEEK : 1; |
| 98 | 98 | switch ($type) { |
| 99 | - case 'Day': |
|
| 100 | - return new Day($y, $m, $d); |
|
| 101 | - case 'Month': |
|
| 102 | - // Set default state for which month type to build |
|
| 103 | - if (!defined('CALENDAR_MONTH_STATE')) { |
|
| 104 | - define('CALENDAR_MONTH_STATE', CALENDAR_USE_MONTH); |
|
| 105 | - } |
|
| 106 | - switch (CALENDAR_MONTH_STATE) { |
|
| 107 | - case CALENDAR_USE_MONTH_WEEKDAYS: |
|
| 108 | - $class = 'Calendar_Month_Weekdays'; |
|
| 109 | - break; |
|
| 110 | - case CALENDAR_USE_MONTH_WEEKS: |
|
| 111 | - $class = 'Calendar_Month_Weeks'; |
|
| 112 | - break; |
|
| 113 | - case CALENDAR_USE_MONTH: |
|
| 114 | - default: |
|
| 115 | - $class = 'Pear\Calendar\Month'; |
|
| 116 | - break; |
|
| 117 | - } |
|
| 99 | + case 'Day': |
|
| 100 | + return new Day($y, $m, $d); |
|
| 101 | + case 'Month': |
|
| 102 | + // Set default state for which month type to build |
|
| 103 | + if (!defined('CALENDAR_MONTH_STATE')) { |
|
| 104 | + define('CALENDAR_MONTH_STATE', CALENDAR_USE_MONTH); |
|
| 105 | + } |
|
| 106 | + switch (CALENDAR_MONTH_STATE) { |
|
| 107 | + case CALENDAR_USE_MONTH_WEEKDAYS: |
|
| 108 | + $class = 'Calendar_Month_Weekdays'; |
|
| 109 | + break; |
|
| 110 | + case CALENDAR_USE_MONTH_WEEKS: |
|
| 111 | + $class = 'Calendar_Month_Weeks'; |
|
| 112 | + break; |
|
| 113 | + case CALENDAR_USE_MONTH: |
|
| 114 | + default: |
|
| 115 | + $class = 'Pear\Calendar\Month'; |
|
| 116 | + break; |
|
| 117 | + } |
|
| 118 | 118 | return new $class($y, $m, $firstDay); |
| 119 | - case 'Week': |
|
| 120 | - return new Week($y, $m, $d, $firstDay); |
|
| 121 | - case 'Hour': |
|
| 122 | - return new Hour($y, $m, $d, $h); |
|
| 123 | - case 'Minute': |
|
| 124 | - return new Minute($y, $m, $d, $h, $i); |
|
| 125 | - case 'Second': |
|
| 126 | - return new Second($y, $m, $d, $h, $i, $s); |
|
| 127 | - case 'Year': |
|
| 128 | - return new Year($y); |
|
| 129 | - default: |
|
| 130 | - include_once 'PEAR.php'; |
|
| 131 | - PEAR::raiseError('Calendar_Factory::create() unrecognised type: '.$type, |
|
| 132 | - null, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar_Factory::create()'); |
|
| 133 | - return false; |
|
| 119 | + case 'Week': |
|
| 120 | + return new Week($y, $m, $d, $firstDay); |
|
| 121 | + case 'Hour': |
|
| 122 | + return new Hour($y, $m, $d, $h); |
|
| 123 | + case 'Minute': |
|
| 124 | + return new Minute($y, $m, $d, $h, $i); |
|
| 125 | + case 'Second': |
|
| 126 | + return new Second($y, $m, $d, $h, $i, $s); |
|
| 127 | + case 'Year': |
|
| 128 | + return new Year($y); |
|
| 129 | + default: |
|
| 130 | + include_once 'PEAR.php'; |
|
| 131 | + PEAR::raiseError('Calendar_Factory::create() unrecognised type: '.$type, |
|
| 132 | + null, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar_Factory::create()'); |
|
| 133 | + return false; |
|
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * |
| 81 | 81 | * @access public |
| 82 | 82 | */ |
| 83 | - function __construct($y, $m, $firstDay=null) |
|
| 83 | + function __construct($y, $m, $firstDay = null) |
|
| 84 | 84 | { |
| 85 | 85 | parent::__construct($y, $m); |
| 86 | 86 | $this->firstDay = $this->defineFirstDayOfWeek($firstDay); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | { |
| 100 | 100 | include_once CALENDAR_ROOT.'Day.php'; |
| 101 | 101 | $daysInMonth = $this->cE->getDaysInMonth($this->year, $this->month); |
| 102 | - for ($i=1; $i<=$daysInMonth; $i++) { |
|
| 102 | + for ($i = 1; $i <= $daysInMonth; $i++) { |
|
| 103 | 103 | $this->children[$i] = new Day($this->year, $this->month, $i); |
| 104 | 104 | } |
| 105 | 105 | if (count($sDates) > 0) { |
@@ -96,12 +96,12 @@ discard block |
||
| 96 | 96 | $stamp = mktime(0, 0, 0, $i, 1, 2003); |
| 97 | 97 | $month = strftime($formats[$format], $stamp); |
| 98 | 98 | switch($format) { |
| 99 | - case 'one': |
|
| 100 | - $month = substr($month, 0, 1); |
|
| 101 | - break; |
|
| 102 | - case 'two': |
|
| 103 | - $month = substr($month, 0, 2); |
|
| 104 | - break; |
|
| 99 | + case 'one': |
|
| 100 | + $month = substr($month, 0, 1); |
|
| 101 | + break; |
|
| 102 | + case 'two': |
|
| 103 | + $month = substr($month, 0, 2); |
|
| 104 | + break; |
|
| 105 | 105 | } |
| 106 | 106 | $months[$i] = $month; |
| 107 | 107 | } |
@@ -133,12 +133,12 @@ discard block |
||
| 133 | 133 | $stamp = mktime(0, 0, 0, 11, $i+2, 2003); |
| 134 | 134 | $day = strftime($formats[$format], $stamp); |
| 135 | 135 | switch($format) { |
| 136 | - case 'one': |
|
| 137 | - $day = substr($day, 0, 1); |
|
| 138 | - break; |
|
| 139 | - case 'two': |
|
| 140 | - $day = substr($day, 0, 2); |
|
| 141 | - break; |
|
| 136 | + case 'one': |
|
| 137 | + $day = substr($day, 0, 1); |
|
| 138 | + break; |
|
| 139 | + case 'two': |
|
| 140 | + $day = substr($day, 0, 2); |
|
| 141 | + break; |
|
| 142 | 142 | } |
| 143 | 143 | $days[$i] = $day; |
| 144 | 144 | } |
@@ -80,10 +80,10 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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(); |
@@ -98,7 +98,7 @@ discard block |
||
| 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 |
||
| 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; |
@@ -118,12 +118,24 @@ |
||
| 118 | 118 | */ |
| 119 | 119 | function setFragments($y, $m=null, $d=null, $h=null, $i=null, $s=null) |
| 120 | 120 | { |
| 121 | - if (!is_null($y)) $this->uris['Year'] = $y; |
|
| 122 | - if (!is_null($m)) $this->uris['Month'] = $m; |
|
| 123 | - if (!is_null($d)) $this->uris['Day'] = $d; |
|
| 124 | - if (!is_null($h)) $this->uris['Hour'] = $h; |
|
| 125 | - if (!is_null($i)) $this->uris['Minute'] = $i; |
|
| 126 | - if (!is_null($s)) $this->uris['Second'] = $s; |
|
| 121 | + if (!is_null($y)) { |
|
| 122 | + $this->uris['Year'] = $y; |
|
| 123 | + } |
|
| 124 | + if (!is_null($m)) { |
|
| 125 | + $this->uris['Month'] = $m; |
|
| 126 | + } |
|
| 127 | + if (!is_null($d)) { |
|
| 128 | + $this->uris['Day'] = $d; |
|
| 129 | + } |
|
| 130 | + if (!is_null($h)) { |
|
| 131 | + $this->uris['Hour'] = $h; |
|
| 132 | + } |
|
| 133 | + if (!is_null($i)) { |
|
| 134 | + $this->uris['Minute'] = $i; |
|
| 135 | + } |
|
| 136 | + if (!is_null($s)) { |
|
| 137 | + $this->uris['Second'] = $s; |
|
| 138 | + } |
|
| 127 | 139 | } |
| 128 | 140 | |
| 129 | 141 | /** |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | * |
| 394 | 394 | * @return int e.g. 4 or Unix timestamp |
| 395 | 395 | * @access public |
| 396 | - */ |
|
| 396 | + */ |
|
| 397 | 397 | function prevMonth($format = 'int') |
| 398 | 398 | { |
| 399 | 399 | return $this->calendar->prevMonth($format); |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | * |
| 433 | 433 | * @return int e.g. 4 or Unix timestamp |
| 434 | 434 | * @access public |
| 435 | - */ |
|
| 435 | + */ |
|
| 436 | 436 | function prevWeek($format = 'n_in_month') |
| 437 | 437 | { |
| 438 | 438 | if ( method_exists($this->calendar, 'prevWeek')) { |
@@ -240,7 +240,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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'; |
@@ -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 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 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 |
||
| 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() |
@@ -119,7 +119,7 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | if (defined('CALENDAR_FIRST_DAY_OF_WEEK')) { |
| 492 | 492 | if (!is_null($firstDay) && ($firstDay != CALENDAR_FIRST_DAY_OF_WEEK)) { |
| 493 | 493 | $msg = 'CALENDAR_FIRST_DAY_OF_WEEK constant already defined.' |
| 494 | - .' The $firstDay parameter will be ignored.'; |
|
| 494 | + .' The $firstDay parameter will be ignored.'; |
|
| 495 | 495 | trigger_error($msg, E_USER_WARNING); |
| 496 | 496 | } |
| 497 | 497 | return CALENDAR_FIRST_DAY_OF_WEEK; |
@@ -714,8 +714,8 @@ discard block |
||
| 714 | 714 | } |
| 715 | 715 | |
| 716 | 716 | /** |
| 717 | - * Returns the value for the next minute |
|
| 718 | - * |
|
| 717 | + * Returns the value for the next minute |
|
| 718 | + * |
|
| 719 | 719 | * @param string $format return value format ['int'|'timestamp'|'object'|'array'] |
| 720 | 720 | * |
| 721 | 721 | * @return int e.g. 25 or timestamp |
@@ -748,8 +748,8 @@ discard block |
||
| 748 | 748 | /** |
| 749 | 749 | * Returns the value for this second |
| 750 | 750 | * |
| 751 | - * @param string $format return value format ['int'|'timestamp'|'object'|'array'] |
|
| 752 | - * |
|
| 751 | + * @param string $format return value format ['int'|'timestamp'|'object'|'array'] |
|
| 752 | + * |
|
| 753 | 753 | * @return int e.g. 44 or timestamp |
| 754 | 754 | * @access public |
| 755 | 755 | */ |
@@ -88,13 +88,13 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -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 | } |