@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | function stampCollection($stamp) |
| 77 | 77 | { |
| 78 | 78 | static $stamps = array(); |
| 79 | - if ( !isset($stamps[$stamp]) ) { |
|
| 79 | + if (!isset($stamps[$stamp])) { |
|
| 80 | 80 | $date = @date('Y n j H i s t W w', $stamp); |
| 81 | 81 | $stamps[$stamp] = sscanf($date, "%d %d %d %d %d %d %d %d %d"); |
| 82 | 82 | } |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | * @return int Unix timestamp |
| 181 | 181 | * @access protected |
| 182 | 182 | */ |
| 183 | - function dateToStamp($y, $m, $d, $h=0, $i=0, $s=0) |
|
| 183 | + function dateToStamp($y, $m, $d, $h = 0, $i = 0, $s = 0) |
|
| 184 | 184 | { |
| 185 | 185 | static $dates = array(); |
| 186 | 186 | if (!isset($dates[$y][$m][$d][$h][$i][$s])) { |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | * @return int (12) |
| 220 | 220 | * @access protected |
| 221 | 221 | */ |
| 222 | - function getMonthsInYear($y=null) |
|
| 222 | + function getMonthsInYear($y = null) |
|
| 223 | 223 | { |
| 224 | 224 | return 12; |
| 225 | 225 | } |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | * @return int (7) |
| 268 | 268 | * @access protected |
| 269 | 269 | */ |
| 270 | - function getDaysInWeek($y=null, $m=null, $d=null) |
|
| 270 | + function getDaysInWeek($y = null, $m = null, $d = null) |
|
| 271 | 271 | { |
| 272 | 272 | return 7; |
| 273 | 273 | } |
@@ -300,9 +300,9 @@ discard block |
||
| 300 | 300 | * @return int week number |
| 301 | 301 | * @access protected |
| 302 | 302 | */ |
| 303 | - function getWeekNInMonth($y, $m, $d, $firstDay=1) |
|
| 303 | + function getWeekNInMonth($y, $m, $d, $firstDay = 1) |
|
| 304 | 304 | { |
| 305 | - $weekEnd = (0 == $firstDay) ? $this->getDaysInWeek()-1 : $firstDay-1; |
|
| 305 | + $weekEnd = (0 == $firstDay) ? $this->getDaysInWeek() - 1 : $firstDay - 1; |
|
| 306 | 306 | $end_of_week = 1; |
| 307 | 307 | while (@date('w', @mktime(0, 0, 0, $m, $end_of_week, $y)) != $weekEnd) { |
| 308 | 308 | ++$end_of_week; //find first weekend of the month |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | * @return array (0,1,2,3,4,5,6) 1 = Monday |
| 371 | 371 | * @access protected |
| 372 | 372 | */ |
| 373 | - function getWeekDays($y=null, $m=null, $d=null) |
|
| 373 | + function getWeekDays($y = null, $m = null, $d = null) |
|
| 374 | 374 | { |
| 375 | 375 | return array(0, 1, 2, 3, 4, 5, 6); |
| 376 | 376 | } |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | * @return int (default 1 = Monday) |
| 386 | 386 | * @access protected |
| 387 | 387 | */ |
| 388 | - function getFirstDayOfWeek($y=null, $m=null, $d=null) |
|
| 388 | + function getFirstDayOfWeek($y = null, $m = null, $d = null) |
|
| 389 | 389 | { |
| 390 | 390 | return 1; |
| 391 | 391 | } |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | * @return int (24) |
| 401 | 401 | * @access protected |
| 402 | 402 | */ |
| 403 | - function getHoursInDay($y=null, $m=null, $d=null) |
|
| 403 | + function getHoursInDay($y = null, $m = null, $d = null) |
|
| 404 | 404 | { |
| 405 | 405 | return 24; |
| 406 | 406 | } |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | * @return int (60) |
| 417 | 417 | * @access protected |
| 418 | 418 | */ |
| 419 | - function getMinutesInHour($y=null, $m=null, $d=null, $h=null) |
|
| 419 | + function getMinutesInHour($y = null, $m = null, $d = null, $h = null) |
|
| 420 | 420 | { |
| 421 | 421 | return 60; |
| 422 | 422 | } |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | * @return int (60) |
| 434 | 434 | * @access protected |
| 435 | 435 | */ |
| 436 | - function getSecondsInMinute($y=null, $m=null, $d=null, $h=null, $i=null) |
|
| 436 | + function getSecondsInMinute($y = null, $m = null, $d = null, $h = null, $i = null) |
|
| 437 | 437 | { |
| 438 | 438 | return 60; |
| 439 | 439 | } |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | $today = sscanf($today_date, '%d %d %d'); |
| 455 | 455 | } |
| 456 | 456 | $date = Calendar_Engine_UnixTS::stampCollection($stamp); |
| 457 | - return ( $date[2] == $today[2] |
|
| 457 | + return ($date[2] == $today[2] |
|
| 458 | 458 | && $date[1] == $today[1] |
| 459 | 459 | && $date[0] == $today[0] |
| 460 | 460 | ); |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | * @return string iso-8601 datetime |
| 172 | 172 | * @access protected |
| 173 | 173 | */ |
| 174 | - function dateToStamp($y, $m, $d, $h=0, $i=0, $s=0) |
|
| 174 | + function dateToStamp($y, $m, $d, $h = 0, $i = 0, $s = 0) |
|
| 175 | 175 | { |
| 176 | 176 | $r = array(); |
| 177 | 177 | Calendar_Engine_PearDate::adjustDate($y, $m, $d, $h, $i, $s); |
@@ -222,8 +222,8 @@ discard block |
||
| 222 | 222 | $d += floor($h / 24); |
| 223 | 223 | $h %= 24; |
| 224 | 224 | } |
| 225 | - for(; $m < 1; $y--, $m+=12); |
|
| 226 | - for(; $m > 12; $y++, $m-=12); |
|
| 225 | + for (; $m < 1; $y--, $m += 12); |
|
| 226 | + for (; $m > 12; $y++, $m -= 12); |
|
| 227 | 227 | |
| 228 | 228 | while ($d < 1) { |
| 229 | 229 | if ($m > 1) { |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | } |
| 235 | 235 | $d += Date_Calc::daysInMonth($m, $y); |
| 236 | 236 | } |
| 237 | - for ($max_days = Date_Calc::daysInMonth($m, $y); $d > $max_days; ) { |
|
| 237 | + for ($max_days = Date_Calc::daysInMonth($m, $y); $d > $max_days;) { |
|
| 238 | 238 | $d -= $max_days; |
| 239 | 239 | if ($m < 12) { |
| 240 | 240 | $m++; |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | * @return int (12) |
| 276 | 276 | * @access protected |
| 277 | 277 | */ |
| 278 | - function getMonthsInYear($y=null) |
|
| 278 | + function getMonthsInYear($y = null) |
|
| 279 | 279 | { |
| 280 | 280 | return 12; |
| 281 | 281 | } |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | * @return int (7) |
| 320 | 320 | * @access protected |
| 321 | 321 | */ |
| 322 | - function getDaysInWeek($y=null, $m=null, $d=null) |
|
| 322 | + function getDaysInWeek($y = null, $m = null, $d = null) |
|
| 323 | 323 | { |
| 324 | 324 | return 7; |
| 325 | 325 | } |
@@ -352,9 +352,9 @@ discard block |
||
| 352 | 352 | * @return int week number |
| 353 | 353 | * @access protected |
| 354 | 354 | */ |
| 355 | - function getWeekNInMonth($y, $m, $d, $firstDay=1) |
|
| 355 | + function getWeekNInMonth($y, $m, $d, $firstDay = 1) |
|
| 356 | 356 | { |
| 357 | - $weekEnd = ($firstDay == 0) ? $this->getDaysInWeek()-1 : $firstDay-1; |
|
| 357 | + $weekEnd = ($firstDay == 0) ? $this->getDaysInWeek() - 1 : $firstDay - 1; |
|
| 358 | 358 | $end_of_week = (int)Date_Calc::nextDayOfWeek($weekEnd, 1, $m, $y, '%e', true); |
| 359 | 359 | $w = 1; |
| 360 | 360 | while ($d > $end_of_week) { |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | * @return int weeks number |
| 375 | 375 | * @access protected |
| 376 | 376 | */ |
| 377 | - function getWeeksInMonth($y, $m, $firstDay=1) |
|
| 377 | + function getWeeksInMonth($y, $m, $firstDay = 1) |
|
| 378 | 378 | { |
| 379 | 379 | $FDOM = Date_Calc::firstOfMonthWeekday($m, $y); |
| 380 | 380 | if ($FDOM == 0) { |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | * @return array (0, 1, 2, 3, 4, 5, 6) 1 = Monday |
| 418 | 418 | * @access protected |
| 419 | 419 | */ |
| 420 | - function getWeekDays($y=null, $m=null, $d=null) |
|
| 420 | + function getWeekDays($y = null, $m = null, $d = null) |
|
| 421 | 421 | { |
| 422 | 422 | return array(0, 1, 2, 3, 4, 5, 6); |
| 423 | 423 | } |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | * @return int (default 1 = Monday) |
| 433 | 433 | * @access protected |
| 434 | 434 | */ |
| 435 | - function getFirstDayOfWeek($y=null, $m=null, $d=null) |
|
| 435 | + function getFirstDayOfWeek($y = null, $m = null, $d = null) |
|
| 436 | 436 | { |
| 437 | 437 | return 1; |
| 438 | 438 | } |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | * @return int (24) |
| 448 | 448 | * @access protected |
| 449 | 449 | */ |
| 450 | - function getHoursInDay($y=null,$m=null,$d=null) |
|
| 450 | + function getHoursInDay($y = null, $m = null, $d = null) |
|
| 451 | 451 | { |
| 452 | 452 | return 24; |
| 453 | 453 | } |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | * @return int (60) |
| 464 | 464 | * @access protected |
| 465 | 465 | */ |
| 466 | - function getMinutesInHour($y=null,$m=null,$d=null,$h=null) |
|
| 466 | + function getMinutesInHour($y = null, $m = null, $d = null, $h = null) |
|
| 467 | 467 | { |
| 468 | 468 | return 60; |
| 469 | 469 | } |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | * @return int (60) |
| 481 | 481 | * @access protected |
| 482 | 482 | */ |
| 483 | - function getSecondsInMinute($y=null,$m=null,$d=null,$h=null,$i=null) |
|
| 483 | + function getSecondsInMinute($y = null, $m = null, $d = null, $h = null, $i = null) |
|
| 484 | 484 | { |
| 485 | 485 | return 60; |
| 486 | 486 | } |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | $today = new Date(); |
| 501 | 501 | } |
| 502 | 502 | $date = Calendar_Engine_PearDate::stampCollection($stamp); |
| 503 | - return ( $date->day == $today->getDay() |
|
| 503 | + return ($date->day == $today->getDay() |
|
| 504 | 504 | && $date->month == $today->getMonth() |
| 505 | 505 | && $date->year == $today->getYear() |
| 506 | 506 | ); |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | include_once CALENDAR_ROOT.'Factory.php'; |
| 108 | 108 | $this->firstDay = $this->defineFirstDayOfWeek($firstDay); |
| 109 | 109 | $monthsInYear = $this->cE->getMonthsInYear($this->thisYear()); |
| 110 | - for ($i=1; $i <= $monthsInYear; $i++) { |
|
| 110 | + for ($i = 1; $i <= $monthsInYear; $i++) { |
|
| 111 | 111 | $this->children[$i] = Calendar_Factory::create('Month', $this->year, $i); |
| 112 | 112 | } |
| 113 | 113 | if (count($sDates) > 0) { |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | include_once CALENDAR_ROOT.'Second.php'; |
| 100 | 100 | $sIM = $this->cE->getSecondsInMinute($this->year, $this->month, |
| 101 | 101 | $this->day, $this->hour, $this->minute); |
| 102 | - for ($i=0; $i < $sIM; $i++) { |
|
| 102 | + for ($i = 0; $i < $sIM; $i++) { |
|
| 103 | 103 | $this->children[$i] = new Calendar_Second($this->year, $this->month, |
| 104 | 104 | $this->day, $this->hour, $this->minute, $i); |
| 105 | 105 | } |
@@ -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'; |
@@ -95,50 +95,50 @@ |
||
| 95 | 95 | { |
| 96 | 96 | $firstDay = defined('CALENDAR_FIRST_DAY_OF_WEEK') ? CALENDAR_FIRST_DAY_OF_WEEK : 1; |
| 97 | 97 | switch ($type) { |
| 98 | - case 'Day': |
|
| 99 | - include_once CALENDAR_ROOT.'Day.php'; |
|
| 100 | - return new Calendar_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 | - include_once CALENDAR_ROOT.'Month/Weekdays.php'; |
|
| 109 | - $class = 'Calendar_Month_Weekdays'; |
|
| 110 | - break; |
|
| 111 | - case CALENDAR_USE_MONTH_WEEKS: |
|
| 112 | - include_once CALENDAR_ROOT.'Month/Weeks.php'; |
|
| 113 | - $class = 'Calendar_Month_Weeks'; |
|
| 114 | - break; |
|
| 115 | - case CALENDAR_USE_MONTH: |
|
| 116 | - default: |
|
| 117 | - include_once CALENDAR_ROOT.'Month.php'; |
|
| 118 | - $class = 'Calendar_Month'; |
|
| 119 | - break; |
|
| 120 | - } |
|
| 98 | + case 'Day': |
|
| 99 | + include_once CALENDAR_ROOT.'Day.php'; |
|
| 100 | + return new Calendar_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 | + include_once CALENDAR_ROOT.'Month/Weekdays.php'; |
|
| 109 | + $class = 'Calendar_Month_Weekdays'; |
|
| 110 | + break; |
|
| 111 | + case CALENDAR_USE_MONTH_WEEKS: |
|
| 112 | + include_once CALENDAR_ROOT.'Month/Weeks.php'; |
|
| 113 | + $class = 'Calendar_Month_Weeks'; |
|
| 114 | + break; |
|
| 115 | + case CALENDAR_USE_MONTH: |
|
| 116 | + default: |
|
| 117 | + include_once CALENDAR_ROOT.'Month.php'; |
|
| 118 | + $class = 'Calendar_Month'; |
|
| 119 | + break; |
|
| 120 | + } |
|
| 121 | 121 | return new $class($y, $m, $firstDay); |
| 122 | - case 'Week': |
|
| 123 | - include_once CALENDAR_ROOT.'Week.php'; |
|
| 124 | - return new Calendar_Week($y, $m, $d, $firstDay); |
|
| 125 | - case 'Hour': |
|
| 126 | - include_once CALENDAR_ROOT.'Hour.php'; |
|
| 127 | - return new Calendar_Hour($y, $m, $d, $h); |
|
| 128 | - case 'Minute': |
|
| 129 | - include_once CALENDAR_ROOT.'Minute.php'; |
|
| 130 | - return new Calendar_Minute($y, $m, $d, $h, $i); |
|
| 131 | - case 'Second': |
|
| 132 | - include_once CALENDAR_ROOT.'Second.php'; |
|
| 133 | - return new Calendar_Second($y, $m, $d, $h, $i, $s); |
|
| 134 | - case 'Year': |
|
| 135 | - include_once CALENDAR_ROOT.'Year.php'; |
|
| 136 | - return new Calendar_Year($y); |
|
| 137 | - default: |
|
| 138 | - include_once 'PEAR.php'; |
|
| 139 | - PEAR::raiseError('Calendar_Factory::create() unrecognised type: '.$type, |
|
| 140 | - null, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar_Factory::create()'); |
|
| 141 | - return false; |
|
| 122 | + case 'Week': |
|
| 123 | + include_once CALENDAR_ROOT.'Week.php'; |
|
| 124 | + return new Calendar_Week($y, $m, $d, $firstDay); |
|
| 125 | + case 'Hour': |
|
| 126 | + include_once CALENDAR_ROOT.'Hour.php'; |
|
| 127 | + return new Calendar_Hour($y, $m, $d, $h); |
|
| 128 | + case 'Minute': |
|
| 129 | + include_once CALENDAR_ROOT.'Minute.php'; |
|
| 130 | + return new Calendar_Minute($y, $m, $d, $h, $i); |
|
| 131 | + case 'Second': |
|
| 132 | + include_once CALENDAR_ROOT.'Second.php'; |
|
| 133 | + return new Calendar_Second($y, $m, $d, $h, $i, $s); |
|
| 134 | + case 'Year': |
|
| 135 | + include_once CALENDAR_ROOT.'Year.php'; |
|
| 136 | + return new Calendar_Year($y); |
|
| 137 | + default: |
|
| 138 | + include_once 'PEAR.php'; |
|
| 139 | + PEAR::raiseError('Calendar_Factory::create() unrecognised type: '.$type, |
|
| 140 | + null, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar_Factory::create()'); |
|
| 141 | + return false; |
|
| 142 | 142 | } |
| 143 | 143 | } |
| 144 | 144 | |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | 'Hour', $h, CALENDAR_VALUE_TOOSMALL.$min); |
| 205 | 205 | return false; |
| 206 | 206 | } |
| 207 | - $max = ($this->cE->getHoursInDay($this->calendar->thisDay())-1); |
|
| 207 | + $max = ($this->cE->getHoursInDay($this->calendar->thisDay()) - 1); |
|
| 208 | 208 | if ($h > $max) { |
| 209 | 209 | $this->errors[] = new Calendar_Validation_Error( |
| 210 | 210 | 'Hour', $h, CALENDAR_VALUE_TOOLARGE.$max); |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | 'Minute', $i, CALENDAR_VALUE_TOOSMALL.$min); |
| 229 | 229 | return false; |
| 230 | 230 | } |
| 231 | - $max = ($this->cE->getMinutesInHour($this->calendar->thisHour())-1); |
|
| 231 | + $max = ($this->cE->getMinutesInHour($this->calendar->thisHour()) - 1); |
|
| 232 | 232 | if ($i > $max) { |
| 233 | 233 | $this->errors[] = new Calendar_Validation_Error( |
| 234 | 234 | 'Minute', $i, CALENDAR_VALUE_TOOLARGE.$max); |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | 'Second', $s, CALENDAR_VALUE_TOOSMALL.$min); |
| 253 | 253 | return false; |
| 254 | 254 | } |
| 255 | - $max = ($this->cE->getSecondsInMinute($this->calendar->thisMinute())-1); |
|
| 255 | + $max = ($this->cE->getSecondsInMinute($this->calendar->thisMinute()) - 1); |
|
| 256 | 256 | if ($s > $max) { |
| 257 | 257 | $this->errors[] = new Calendar_Validation_Error( |
| 258 | 258 | 'Second', $s, CALENDAR_VALUE_TOOLARGE.$max); |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | * @return string |
| 370 | 370 | * @access public |
| 371 | 371 | */ |
| 372 | - function toString () |
|
| 372 | + function toString() |
|
| 373 | 373 | { |
| 374 | 374 | return $this->unit.' = '.$this->value.' ['.$this->message.']'; |
| 375 | 375 | } |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | * |
| 115 | 115 | * @access protected |
| 116 | 116 | */ |
| 117 | - function __construct(& $calendar, $firstDay=null) |
|
| 117 | + function __construct(& $calendar, $firstDay = null) |
|
| 118 | 118 | { |
| 119 | 119 | $this->calendar = & $calendar; |
| 120 | 120 | $this->cE = & $calendar->getEngine(); |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | $this->calendar->thisYear(), $this->calendar->thisMonth()); |
| 173 | 173 | $firstDayInMonth = $this->cE->getFirstDayInMonth( |
| 174 | 174 | $this->calendar->thisYear(), $this->calendar->thisMonth()); |
| 175 | - $this->emptyBefore=0; |
|
| 175 | + $this->emptyBefore = 0; |
|
| 176 | 176 | foreach ($this->daysOfMonth as $dayOfWeek) { |
| 177 | 177 | if ($firstDayInMonth == $dayOfWeek) { |
| 178 | 178 | break; |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $this->calendar->thisDay() |
| 189 | 189 | ) |
| 190 | 190 | ); |
| 191 | - for ($i=1; $i < $this->numWeeks; $i++) { |
|
| 191 | + for ($i = 1; $i < $this->numWeeks; $i++) { |
|
| 192 | 192 | $this->daysOfMonth = |
| 193 | 193 | array_merge($this->daysOfMonth, $this->daysOfWeek); |
| 194 | 194 | } |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | $this->calendar->thisYear(), |
| 284 | 284 | $this->calendar->thisMonth(), |
| 285 | 285 | $this->calendar->thisDay() |
| 286 | - ) * ($this->numWeeks-1)); |
|
| 286 | + ) * ($this->numWeeks - 1)); |
|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | /** |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | * |
| 297 | 297 | * @return int timestamp |
| 298 | 298 | */ |
| 299 | - function getWeekStart($y, $m, $d, $firstDay=1) |
|
| 299 | + function getWeekStart($y, $m, $d, $firstDay = 1) |
|
| 300 | 300 | { |
| 301 | 301 | $dow = $this->cE->getDayOfWeek($y, $m, $d); |
| 302 | 302 | if ($dow > $firstDay) { |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * |
| 80 | 80 | * @access public |
| 81 | 81 | */ |
| 82 | - function __construct($y, $m, $firstDay=null) |
|
| 82 | + function __construct($y, $m, $firstDay = null) |
|
| 83 | 83 | { |
| 84 | 84 | parent::__construct($y, $m); |
| 85 | 85 | $this->firstDay = $this->defineFirstDayOfWeek($firstDay); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | { |
| 99 | 99 | include_once CALENDAR_ROOT.'Day.php'; |
| 100 | 100 | $daysInMonth = $this->cE->getDaysInMonth($this->year, $this->month); |
| 101 | - for ($i=1; $i<=$daysInMonth; $i++) { |
|
| 101 | + for ($i = 1; $i <= $daysInMonth; $i++) { |
|
| 102 | 102 | $this->children[$i] = new Calendar_Day($this->year, $this->month, $i); |
| 103 | 103 | } |
| 104 | 104 | if (count($sDates) > 0) { |