@@ -48,12 +48,12 @@ |
||
48 | 48 | /** |
49 | 49 | * Load Calendar decorator base class |
50 | 50 | */ |
51 | -require_once CALENDAR_ROOT . 'Decorator.php'; |
|
51 | +require_once CALENDAR_ROOT.'Decorator.php'; |
|
52 | 52 | |
53 | 53 | /** |
54 | 54 | * Load the Uri utility |
55 | 55 | */ |
56 | -require_once CALENDAR_ROOT . 'Util/Textual.php'; |
|
56 | +require_once CALENDAR_ROOT.'Util/Textual.php'; |
|
57 | 57 | |
58 | 58 | /** |
59 | 59 | * Decorator to help with fetching textual representations of months and |
@@ -48,7 +48,7 @@ |
||
48 | 48 | /** |
49 | 49 | * Load Calendar decorator base class |
50 | 50 | */ |
51 | -require_once CALENDAR_ROOT . 'Decorator.php'; |
|
51 | +require_once CALENDAR_ROOT.'Decorator.php'; |
|
52 | 52 | |
53 | 53 | /** |
54 | 54 | * Decorator to help with wrapping built children in another decorator |
@@ -48,12 +48,12 @@ |
||
48 | 48 | /** |
49 | 49 | * Load Calendar decorator base class |
50 | 50 | */ |
51 | -require_once CALENDAR_ROOT . 'Decorator.php'; |
|
51 | +require_once CALENDAR_ROOT.'Decorator.php'; |
|
52 | 52 | |
53 | 53 | /** |
54 | 54 | * Load the Uri utility |
55 | 55 | */ |
56 | -require_once CALENDAR_ROOT . 'Util/Uri.php'; |
|
56 | +require_once CALENDAR_ROOT.'Util/Uri.php'; |
|
57 | 57 | |
58 | 58 | /** |
59 | 59 | * Decorator to help with building HTML links for navigating the calendar<br /> |
@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | /** |
49 | 49 | * Load Calendar decorator base class |
50 | 50 | */ |
51 | -require_once CALENDAR_ROOT . 'Decorator.php'; |
|
51 | +require_once CALENDAR_ROOT.'Decorator.php'; |
|
52 | 52 | |
53 | 53 | /** |
54 | 54 | * Load a Calendar_Day |
55 | 55 | */ |
56 | -require_once CALENDAR_ROOT . 'Day.php'; |
|
56 | +require_once CALENDAR_ROOT.'Day.php'; |
|
57 | 57 | |
58 | 58 | /** |
59 | 59 | * Decorator for fetching the day of the week |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | */ |
105 | 105 | public function setFirstDay($firstDay) |
106 | 106 | { |
107 | - $this->firstDay = (int)$firstDay; |
|
107 | + $this->firstDay = (int) $firstDay; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * Load Calendar base class |
49 | 49 | */ |
50 | -require_once CALENDAR_ROOT . 'Calendar.php'; |
|
50 | +require_once CALENDAR_ROOT.'Calendar.php'; |
|
51 | 51 | |
52 | 52 | /** |
53 | 53 | * Represents a Minute and builds Seconds |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public function build($sDates = array()) |
98 | 98 | { |
99 | - include_once CALENDAR_ROOT . 'Second.php'; |
|
99 | + include_once CALENDAR_ROOT.'Second.php'; |
|
100 | 100 | $sIM = $this->cE->getSecondsInMinute($this->year, $this->month, $this->day, $this->hour, $this->minute); |
101 | 101 | for ($i = 0; $i < $sIM; ++$i) { |
102 | 102 | $this->children[$i] = new Calendar_Second($this->year, $this->month, $this->day, $this->hour, $this->minute, $i); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | { |
121 | 121 | foreach ($sDates as $sDate) { |
122 | 122 | if ($this->year == $sDate->thisYear() && $this->month == $sDate->thisMonth() && $this->day == $sDate->thisDay() && $this->hour == $sDate->thisHour() && $this->minute == $sDate->thisMinute()) { |
123 | - $key = (int)$sDate->thisSecond(); |
|
123 | + $key = (int) $sDate->thisSecond(); |
|
124 | 124 | if (isset($this->children[$key])) { |
125 | 125 | $sDate->setSelected(); |
126 | 126 | $this->children[$key] = $sDate; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * Load Calendar base class |
49 | 49 | */ |
50 | -require_once CALENDAR_ROOT . 'Calendar.php'; |
|
50 | +require_once CALENDAR_ROOT.'Calendar.php'; |
|
51 | 51 | |
52 | 52 | /** |
53 | 53 | * Represents an Hour and builds Minutes |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function build($sDates = array()) |
97 | 97 | { |
98 | - include_once CALENDAR_ROOT . 'Minute.php'; |
|
98 | + include_once CALENDAR_ROOT.'Minute.php'; |
|
99 | 99 | $mIH = $this->cE->getMinutesInHour($this->year, $this->month, $this->day, $this->hour); |
100 | 100 | for ($i = 0; $i < $mIH; ++$i) { |
101 | 101 | $this->children[$i] = new Calendar_Minute($this->year, $this->month, $this->day, $this->hour, $i); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | { |
120 | 120 | foreach ($sDates as $sDate) { |
121 | 121 | if ($this->year == $sDate->thisYear() && $this->month == $sDate->thisMonth() && $this->day == $sDate->thisDay() && $this->hour == $sDate->thisHour()) { |
122 | - $key = (int)$sDate->thisMinute(); |
|
122 | + $key = (int) $sDate->thisMinute(); |
|
123 | 123 | if (isset($this->children[$key])) { |
124 | 124 | $sDate->setSelected(); |
125 | 125 | $this->children[$key] = $sDate; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function __construct(&$calendar) |
93 | 93 | { |
94 | - $this->calendar =& $calendar; |
|
94 | + $this->calendar = & $calendar; |
|
95 | 95 | $this->cE = &$calendar->getEngine(); |
96 | 96 | } |
97 | 97 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | 'isValidHour', |
111 | 111 | 'isValidMinute', |
112 | 112 | 'isValidSecond'); |
113 | - $valid = true; |
|
113 | + $valid = true; |
|
114 | 114 | foreach ($checks as $check) { |
115 | 115 | if (!$this->{$check}()) { |
116 | 116 | $valid = false; |
@@ -131,13 +131,13 @@ discard block |
||
131 | 131 | $y = $this->calendar->thisYear(); |
132 | 132 | $min = $this->cE->getMinYears(); |
133 | 133 | if ($min > $y) { |
134 | - $this->errors[] = new Calendar_Validation_Error('Year', $y, CALENDAR_VALUE_TOOSMALL . $min); |
|
134 | + $this->errors[] = new Calendar_Validation_Error('Year', $y, CALENDAR_VALUE_TOOSMALL.$min); |
|
135 | 135 | |
136 | 136 | return false; |
137 | 137 | } |
138 | 138 | $max = $this->cE->getMaxYears(); |
139 | 139 | if ($y > $max) { |
140 | - $this->errors[] = new Calendar_Validation_Error('Year', $y, CALENDAR_VALUE_TOOLARGE . $max); |
|
140 | + $this->errors[] = new Calendar_Validation_Error('Year', $y, CALENDAR_VALUE_TOOLARGE.$max); |
|
141 | 141 | |
142 | 142 | return false; |
143 | 143 | } |
@@ -156,13 +156,13 @@ discard block |
||
156 | 156 | $m = $this->calendar->thisMonth(); |
157 | 157 | $min = 1; |
158 | 158 | if ($min > $m) { |
159 | - $this->errors[] = new Calendar_Validation_Error('Month', $m, CALENDAR_VALUE_TOOSMALL . $min); |
|
159 | + $this->errors[] = new Calendar_Validation_Error('Month', $m, CALENDAR_VALUE_TOOSMALL.$min); |
|
160 | 160 | |
161 | 161 | return false; |
162 | 162 | } |
163 | 163 | $max = $this->cE->getMonthsInYear($this->calendar->thisYear()); |
164 | 164 | if ($m > $max) { |
165 | - $this->errors[] = new Calendar_Validation_Error('Month', $m, CALENDAR_VALUE_TOOLARGE . $max); |
|
165 | + $this->errors[] = new Calendar_Validation_Error('Month', $m, CALENDAR_VALUE_TOOLARGE.$max); |
|
166 | 166 | |
167 | 167 | return false; |
168 | 168 | } |
@@ -181,13 +181,13 @@ discard block |
||
181 | 181 | $d = $this->calendar->thisDay(); |
182 | 182 | $min = 1; |
183 | 183 | if ($min > $d) { |
184 | - $this->errors[] = new Calendar_Validation_Error('Day', $d, CALENDAR_VALUE_TOOSMALL . $min); |
|
184 | + $this->errors[] = new Calendar_Validation_Error('Day', $d, CALENDAR_VALUE_TOOSMALL.$min); |
|
185 | 185 | |
186 | 186 | return false; |
187 | 187 | } |
188 | 188 | $max = $this->cE->getDaysInMonth($this->calendar->thisYear(), $this->calendar->thisMonth()); |
189 | 189 | if ($d > $max) { |
190 | - $this->errors[] = new Calendar_Validation_Error('Day', $d, CALENDAR_VALUE_TOOLARGE . $max); |
|
190 | + $this->errors[] = new Calendar_Validation_Error('Day', $d, CALENDAR_VALUE_TOOLARGE.$max); |
|
191 | 191 | |
192 | 192 | return false; |
193 | 193 | } |
@@ -206,13 +206,13 @@ discard block |
||
206 | 206 | $h = $this->calendar->thisHour(); |
207 | 207 | $min = 0; |
208 | 208 | if ($min > $h) { |
209 | - $this->errors[] = new Calendar_Validation_Error('Hour', $h, CALENDAR_VALUE_TOOSMALL . $min); |
|
209 | + $this->errors[] = new Calendar_Validation_Error('Hour', $h, CALENDAR_VALUE_TOOSMALL.$min); |
|
210 | 210 | |
211 | 211 | return false; |
212 | 212 | } |
213 | 213 | $max = ($this->cE->getHoursInDay($this->calendar->thisDay()) - 1); |
214 | 214 | if ($h > $max) { |
215 | - $this->errors[] = new Calendar_Validation_Error('Hour', $h, CALENDAR_VALUE_TOOLARGE . $max); |
|
215 | + $this->errors[] = new Calendar_Validation_Error('Hour', $h, CALENDAR_VALUE_TOOLARGE.$max); |
|
216 | 216 | |
217 | 217 | return false; |
218 | 218 | } |
@@ -231,13 +231,13 @@ discard block |
||
231 | 231 | $i = $this->calendar->thisMinute(); |
232 | 232 | $min = 0; |
233 | 233 | if ($min > $i) { |
234 | - $this->errors[] = new Calendar_Validation_Error('Minute', $i, CALENDAR_VALUE_TOOSMALL . $min); |
|
234 | + $this->errors[] = new Calendar_Validation_Error('Minute', $i, CALENDAR_VALUE_TOOSMALL.$min); |
|
235 | 235 | |
236 | 236 | return false; |
237 | 237 | } |
238 | 238 | $max = ($this->cE->getMinutesInHour($this->calendar->thisHour()) - 1); |
239 | 239 | if ($i > $max) { |
240 | - $this->errors[] = new Calendar_Validation_Error('Minute', $i, CALENDAR_VALUE_TOOLARGE . $max); |
|
240 | + $this->errors[] = new Calendar_Validation_Error('Minute', $i, CALENDAR_VALUE_TOOLARGE.$max); |
|
241 | 241 | |
242 | 242 | return false; |
243 | 243 | } |
@@ -256,13 +256,13 @@ discard block |
||
256 | 256 | $s = $this->calendar->thisSecond(); |
257 | 257 | $min = 0; |
258 | 258 | if ($min > $s) { |
259 | - $this->errors[] = new Calendar_Validation_Error('Second', $s, CALENDAR_VALUE_TOOSMALL . $min); |
|
259 | + $this->errors[] = new Calendar_Validation_Error('Second', $s, CALENDAR_VALUE_TOOSMALL.$min); |
|
260 | 260 | |
261 | 261 | return false; |
262 | 262 | } |
263 | 263 | $max = ($this->cE->getSecondsInMinute($this->calendar->thisMinute()) - 1); |
264 | 264 | if ($s > $max) { |
265 | - $this->errors[] = new Calendar_Validation_Error('Second', $s, CALENDAR_VALUE_TOOLARGE . $max); |
|
265 | + $this->errors[] = new Calendar_Validation_Error('Second', $s, CALENDAR_VALUE_TOOLARGE.$max); |
|
266 | 266 | |
267 | 267 | return false; |
268 | 268 | } |
@@ -381,6 +381,6 @@ discard block |
||
381 | 381 | */ |
382 | 382 | public function toString() |
383 | 383 | { |
384 | - return $this->unit . ' = ' . $this->value . ' [' . $this->message . ']'; |
|
384 | + return $this->unit.' = '.$this->value.' ['.$this->message.']'; |
|
385 | 385 | } |
386 | 386 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * Load Calendar base class |
49 | 49 | */ |
50 | -require_once CALENDAR_ROOT . 'Calendar.php'; |
|
50 | +require_once CALENDAR_ROOT.'Calendar.php'; |
|
51 | 51 | |
52 | 52 | /** |
53 | 53 | * Represents a Month and builds Days |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public function build($sDates = array()) |
98 | 98 | { |
99 | - include_once CALENDAR_ROOT . 'Day.php'; |
|
99 | + include_once CALENDAR_ROOT.'Day.php'; |
|
100 | 100 | $daysInMonth = $this->cE->getDaysInMonth($this->year, $this->month); |
101 | 101 | for ($i = 1; $i <= $daysInMonth; ++$i) { |
102 | 102 | $this->children[$i] = new Calendar_Day($this->year, $this->month, $i); |
@@ -27,12 +27,12 @@ |
||
27 | 27 | public function testPrevDay_Array() |
28 | 28 | { |
29 | 29 | $this->assertEqual(array( |
30 | - 'year' => 2003, |
|
31 | - 'month' => 10, |
|
32 | - 'day' => 24, |
|
33 | - 'hour' => 0, |
|
34 | - 'minute' => 0, |
|
35 | - 'second' => 0), $this->cal->prevDay('array')); |
|
30 | + 'year' => 2003, |
|
31 | + 'month' => 10, |
|
32 | + 'day' => 24, |
|
33 | + 'hour' => 0, |
|
34 | + 'minute' => 0, |
|
35 | + 'second' => 0), $this->cal->prevDay('array')); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | public function testPrevHour() |
@@ -130,7 +130,7 @@ |
||
130 | 130 | |
131 | 131 | public function testSelection() |
132 | 132 | { |
133 | - require_once(CALENDAR_ROOT . 'Hour.php'); |
|
133 | + require_once(CALENDAR_ROOT.'Hour.php'); |
|
134 | 134 | $selection = array(new Calendar_Hour(2003, 10, 25, 13)); |
135 | 135 | $this->cal->build($selection); |
136 | 136 | $i = 0; |