@@ -5,9 +5,9 @@ discard block |
||
5 | 5 | if (!@include 'Calendar/Calendar.php') { |
6 | 6 | define('CALENDAR_ROOT', '../../'); |
7 | 7 | } |
8 | -require_once CALENDAR_ROOT . 'Month.php'; |
|
9 | -require_once CALENDAR_ROOT . 'Decorator.php'; // Not really needed but added to help this make sense |
|
10 | -require_once CALENDAR_ROOT . 'Decorator/Wrapper.php'; |
|
8 | +require_once CALENDAR_ROOT.'Month.php'; |
|
9 | +require_once CALENDAR_ROOT.'Decorator.php'; // Not really needed but added to help this make sense |
|
10 | +require_once CALENDAR_ROOT.'Decorator/Wrapper.php'; |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * Class MyBoldDecorator. |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function thisDay() |
29 | 29 | { |
30 | - return '<b>' . parent::thisDay() . '</b>'; |
|
30 | + return '<b>'.parent::thisDay().'</b>'; |
|
31 | 31 | } |
32 | 32 | } |
33 | 33 | |
@@ -39,5 +39,5 @@ discard block |
||
39 | 39 | echo '<h2>The Wrapper decorator</h2>'; |
40 | 40 | echo '<i>Day numbers are rendered in bold</i><br> <br>'; |
41 | 41 | while ($DecoratedDay = $Wrapper->fetch('MyBoldDecorator')) { |
42 | - echo $DecoratedDay->thisDay() . '<br>'; |
|
42 | + echo $DecoratedDay->thisDay().'<br>'; |
|
43 | 43 | } |
@@ -5,8 +5,8 @@ discard block |
||
5 | 5 | if (!@include 'Calendar/Calendar.php') { |
6 | 6 | define('CALENDAR_ROOT', '../../'); |
7 | 7 | } |
8 | -require_once CALENDAR_ROOT . 'Month/Weekdays.php'; |
|
9 | -require_once CALENDAR_ROOT . 'Util/Uri.php'; |
|
8 | +require_once CALENDAR_ROOT.'Month/Weekdays.php'; |
|
9 | +require_once CALENDAR_ROOT.'Util/Uri.php'; |
|
10 | 10 | |
11 | 11 | if (!isset($_GET['jahr'])) { |
12 | 12 | $_GET['jahr'] = date('Y'); |
@@ -18,15 +18,15 @@ discard block |
||
18 | 18 | // Build the month |
19 | 19 | $Calendar = new Calendar_Month_Weekdays($_GET['jahr'], $_GET['monat']); |
20 | 20 | |
21 | -echo '<p>The current month is ' . $Calendar->thisMonth() . ' of year ' . $Calendar->thisYear() . '</p>'; |
|
21 | +echo '<p>The current month is '.$Calendar->thisMonth().' of year '.$Calendar->thisYear().'</p>'; |
|
22 | 22 | |
23 | 23 | $Uri = new Calendar_Util_Uri('jahr', 'monat'); |
24 | 24 | $Uri->setFragments('jahr', 'monat'); |
25 | 25 | |
26 | 26 | echo '"Vector" URIs<pre>'; |
27 | -echo "Previous Uri:\t" . htmlentities($Uri->prev($Calendar, 'month')) . "\n"; |
|
28 | -echo "This Uri:\t" . htmlentities($Uri->this($Calendar, 'month')) . "\n"; |
|
29 | -echo "Next Uri:\t" . htmlentities($Uri->next($Calendar, 'month')) . "\n"; |
|
27 | +echo "Previous Uri:\t".htmlentities($Uri->prev($Calendar, 'month'))."\n"; |
|
28 | +echo "This Uri:\t".htmlentities($Uri->this($Calendar, 'month'))."\n"; |
|
29 | +echo "Next Uri:\t".htmlentities($Uri->next($Calendar, 'month'))."\n"; |
|
30 | 30 | echo '</pre>'; |
31 | 31 | |
32 | 32 | // Switch to scalar URIs |
@@ -34,9 +34,9 @@ discard block |
||
34 | 34 | $Uri->scalar = true; // Omit variable names |
35 | 35 | |
36 | 36 | echo '"Scalar" URIs<pre>'; |
37 | -echo "Previous Uri:\t" . $Uri->prev($Calendar, 'month') . "\n"; |
|
38 | -echo "This Uri:\t" . $Uri->this($Calendar, 'month') . "\n"; |
|
39 | -echo "Next Uri:\t" . $Uri->next($Calendar, 'month') . "\n"; |
|
37 | +echo "Previous Uri:\t".$Uri->prev($Calendar, 'month')."\n"; |
|
38 | +echo "This Uri:\t".$Uri->this($Calendar, 'month')."\n"; |
|
39 | +echo "Next Uri:\t".$Uri->next($Calendar, 'month')."\n"; |
|
40 | 40 | echo '</pre>'; |
41 | 41 | |
42 | 42 | // Restore the vector URIs |
@@ -44,6 +44,6 @@ discard block |
||
44 | 44 | $Uri->scalar = false; |
45 | 45 | ?> |
46 | 46 | <p> |
47 | - <a href="<?php echo $_SERVER['PHP_SELF'] . '?' . $Uri->prev($Calendar, 'month'); ?>">Prev</a> : |
|
48 | - <a href="<?php echo $_SERVER['PHP_SELF'] . '?' . $Uri->next($Calendar, 'month'); ?>">Next</a> |
|
47 | + <a href="<?php echo $_SERVER['PHP_SELF'].'?'.$Uri->prev($Calendar, 'month'); ?>">Prev</a> : |
|
48 | + <a href="<?php echo $_SERVER['PHP_SELF'].'?'.$Uri->next($Calendar, 'month'); ?>">Next</a> |
|
49 | 49 | </p> |
@@ -49,7 +49,7 @@ |
||
49 | 49 | /** |
50 | 50 | * Load Calendar base class. |
51 | 51 | */ |
52 | -require_once CALENDAR_ROOT . 'Calendar.php'; |
|
52 | +require_once CALENDAR_ROOT.'Calendar.php'; |
|
53 | 53 | |
54 | 54 | /** |
55 | 55 | * Represents a Second<br> |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function __construct(&$calendar) |
82 | 82 | { |
83 | - $this->calendar =& $calendar; |
|
83 | + $this->calendar = & $calendar; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -403,8 +403,8 @@ discard block |
||
403 | 403 | if (method_exists($this->calendar, 'prevWeek')) { |
404 | 404 | return $this->calendar->prevWeek($format); |
405 | 405 | } else { |
406 | - require_once __DIR__ . '/PEAR.php'; |
|
407 | - PEAR::raiseError('Cannot call prevWeek on Calendar object of type: ' . get_class($this->calendar), 133, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar_Decorator::prevWeek()'); |
|
406 | + require_once __DIR__.'/PEAR.php'; |
|
407 | + PEAR::raiseError('Cannot call prevWeek on Calendar object of type: '.get_class($this->calendar), 133, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar_Decorator::prevWeek()'); |
|
408 | 408 | |
409 | 409 | return false; |
410 | 410 | } |
@@ -422,8 +422,8 @@ discard block |
||
422 | 422 | if (method_exists($this->calendar, 'thisWeek')) { |
423 | 423 | return $this->calendar->thisWeek($format); |
424 | 424 | } else { |
425 | - require_once __DIR__ . '/PEAR.php'; |
|
426 | - PEAR::raiseError('Cannot call thisWeek on Calendar object of type: ' . get_class($this->calendar), 133, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar_Decorator::thisWeek()'); |
|
425 | + require_once __DIR__.'/PEAR.php'; |
|
426 | + PEAR::raiseError('Cannot call thisWeek on Calendar object of type: '.get_class($this->calendar), 133, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar_Decorator::thisWeek()'); |
|
427 | 427 | |
428 | 428 | return false; |
429 | 429 | } |
@@ -441,8 +441,8 @@ discard block |
||
441 | 441 | if (method_exists($this->calendar, 'nextWeek')) { |
442 | 442 | return $this->calendar->nextWeek($format); |
443 | 443 | } else { |
444 | - require_once __DIR__ . '/PEAR.php'; |
|
445 | - PEAR::raiseError('Cannot call thisWeek on Calendar object of type: ' . get_class($this->calendar), 133, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar_Decorator::nextWeek()'); |
|
444 | + require_once __DIR__.'/PEAR.php'; |
|
445 | + PEAR::raiseError('Cannot call thisWeek on Calendar object of type: '.get_class($this->calendar), 133, PEAR_ERROR_TRIGGER, E_USER_NOTICE, 'Calendar_Decorator::nextWeek()'); |
|
446 | 446 | |
447 | 447 | return false; |
448 | 448 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | /** |
137 | 137 | * Returns the date as an associative array (helper method). |
138 | 138 | * |
139 | - * @param mixed $stamp timestamp (leave empty for current timestamp) |
|
139 | + * @param integer $stamp timestamp (leave empty for current timestamp) |
|
140 | 140 | * |
141 | 141 | * @return array |
142 | 142 | */ |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | * |
243 | 243 | * @param array $sDates array containing Calendar objects to select (optional) |
244 | 244 | * |
245 | - * @return bool |
|
245 | + * @return boolean|null |
|
246 | 246 | * @abstract |
247 | 247 | */ |
248 | 248 | public function build($sDates = []) |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | /** |
51 | 51 | * Load Calendar decorator base class. |
52 | 52 | */ |
53 | -require_once CALENDAR_ROOT . 'Decorator.php'; |
|
53 | +require_once CALENDAR_ROOT.'Decorator.php'; |
|
54 | 54 | |
55 | 55 | /** |
56 | 56 | * Load a Calendar_Day. |
57 | 57 | */ |
58 | -require_once CALENDAR_ROOT . 'Day.php'; |
|
58 | +require_once CALENDAR_ROOT.'Day.php'; |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * Decorator for fetching the day of the week |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | */ |
102 | 102 | public function setFirstDay($firstDay) |
103 | 103 | { |
104 | - $this->firstDay = (int)$firstDay; |
|
104 | + $this->firstDay = (int) $firstDay; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -50,12 +50,12 @@ |
||
50 | 50 | /** |
51 | 51 | * Load Calendar decorator base class. |
52 | 52 | */ |
53 | -require_once CALENDAR_ROOT . 'Decorator.php'; |
|
53 | +require_once CALENDAR_ROOT.'Decorator.php'; |
|
54 | 54 | |
55 | 55 | /** |
56 | 56 | * Load the Uri utility. |
57 | 57 | */ |
58 | -require_once CALENDAR_ROOT . 'Util/Textual.php'; |
|
58 | +require_once CALENDAR_ROOT.'Util/Textual.php'; |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * Decorator to help with fetching textual representations of months and |
@@ -50,7 +50,7 @@ |
||
50 | 50 | /** |
51 | 51 | * Load Calendar decorator base class. |
52 | 52 | */ |
53 | -require_once CALENDAR_ROOT . 'Decorator.php'; |
|
53 | +require_once CALENDAR_ROOT.'Decorator.php'; |
|
54 | 54 | |
55 | 55 | /** |
56 | 56 | * Decorator to help with wrapping built children in another decorator. |
@@ -50,12 +50,12 @@ |
||
50 | 50 | /** |
51 | 51 | * Load Calendar decorator base class. |
52 | 52 | */ |
53 | -require_once CALENDAR_ROOT . 'Decorator.php'; |
|
53 | +require_once CALENDAR_ROOT.'Decorator.php'; |
|
54 | 54 | |
55 | 55 | /** |
56 | 56 | * Load the Uri utility. |
57 | 57 | */ |
58 | -require_once CALENDAR_ROOT . 'Util/Uri.php'; |
|
58 | +require_once CALENDAR_ROOT.'Util/Uri.php'; |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * Decorator to help with building HTML links for navigating the calendar<br> |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | /** |
54 | 54 | * Load Calendar decorator base class. |
55 | 55 | */ |
56 | -require_once CALENDAR_ROOT . 'Decorator.php'; |
|
56 | +require_once CALENDAR_ROOT.'Decorator.php'; |
|
57 | 57 | |
58 | 58 | /** |
59 | 59 | * Static utlities to help with fetching textual representations of months and |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $days = self::weekdayNames($format); |
208 | 208 | $stamp = $Calendar->prevDay('timestamp'); |
209 | 209 | $cE = $Calendar->getEngine(); |
210 | - require_once __DIR__ . '/Date/Calc.php'; |
|
210 | + require_once __DIR__.'/Date/Calc.php'; |
|
211 | 211 | $day = Date_Calc::dayOfWeek($cE->stampToDay($stamp), $cE->stampToMonth($stamp), $cE->stampToYear($stamp)); |
212 | 212 | |
213 | 213 | return $days[$day]; |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | public static function thisDayName($Calendar, $format = 'long') |
227 | 227 | { |
228 | 228 | $days = self::weekdayNames($format); |
229 | - require_once __DIR__ . '/Date/Calc.php'; |
|
229 | + require_once __DIR__.'/Date/Calc.php'; |
|
230 | 230 | $day = Date_Calc::dayOfWeek($Calendar->thisDay(), $Calendar->thisMonth(), $Calendar->thisYear()); |
231 | 231 | |
232 | 232 | return $days[$day]; |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | $days = self::weekdayNames($format); |
247 | 247 | $stamp = $Calendar->nextDay('timestamp'); |
248 | 248 | $cE = $Calendar->getEngine(); |
249 | - require_once __DIR__ . '/Date/Calc.php'; |
|
249 | + require_once __DIR__.'/Date/Calc.php'; |
|
250 | 250 | $day = Date_Calc::dayOfWeek($cE->stampToDay($stamp), $cE->stampToMonth($stamp), $cE->stampToYear($stamp)); |
251 | 251 | |
252 | 252 | return $days[$day]; |