@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | } |
18 | 18 | function setUp() |
19 | 19 | { |
20 | - $this->cal = new Calendar_Hour(2003,10,25,13); |
|
20 | + $this->cal = new Calendar_Hour(2003, 10, 25, 13); |
|
21 | 21 | } |
22 | - function testPrevDay_Array () |
|
22 | + function testPrevDay_Array() |
|
23 | 23 | { |
24 | 24 | $this->assertEqual( |
25 | 25 | array( |
@@ -31,34 +31,34 @@ discard block |
||
31 | 31 | 'second' => 0), |
32 | 32 | $this->cal->prevDay('array')); |
33 | 33 | } |
34 | - function testPrevMinute () |
|
34 | + function testPrevMinute() |
|
35 | 35 | { |
36 | - $this->assertEqual(59,$this->cal->prevMinute()); |
|
36 | + $this->assertEqual(59, $this->cal->prevMinute()); |
|
37 | 37 | } |
38 | - function testThisMinute () |
|
38 | + function testThisMinute() |
|
39 | 39 | { |
40 | - $this->assertEqual(0,$this->cal->thisMinute()); |
|
40 | + $this->assertEqual(0, $this->cal->thisMinute()); |
|
41 | 41 | } |
42 | - function testNextMinute () |
|
42 | + function testNextMinute() |
|
43 | 43 | { |
44 | - $this->assertEqual(1,$this->cal->nextMinute()); |
|
44 | + $this->assertEqual(1, $this->cal->nextMinute()); |
|
45 | 45 | } |
46 | - function testPrevSecond () |
|
46 | + function testPrevSecond() |
|
47 | 47 | { |
48 | - $this->assertEqual(59,$this->cal->prevSecond()); |
|
48 | + $this->assertEqual(59, $this->cal->prevSecond()); |
|
49 | 49 | } |
50 | - function testThisSecond () |
|
50 | + function testThisSecond() |
|
51 | 51 | { |
52 | - $this->assertEqual(0,$this->cal->thisSecond()); |
|
52 | + $this->assertEqual(0, $this->cal->thisSecond()); |
|
53 | 53 | } |
54 | - function testNextSecond () |
|
54 | + function testNextSecond() |
|
55 | 55 | { |
56 | - $this->assertEqual(1,$this->cal->nextSecond()); |
|
56 | + $this->assertEqual(1, $this->cal->nextSecond()); |
|
57 | 57 | } |
58 | 58 | function testGetTimeStamp() |
59 | 59 | { |
60 | - $stamp = mktime(13,0,0,10,25,2003); |
|
61 | - $this->assertEqual($stamp,$this->cal->getTimeStamp()); |
|
60 | + $stamp = mktime(13, 0, 0, 10, 25, 2003); |
|
61 | + $this->assertEqual($stamp, $this->cal->getTimeStamp()); |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 | |
@@ -74,36 +74,36 @@ discard block |
||
74 | 74 | function testSize() |
75 | 75 | { |
76 | 76 | $this->cal->build(); |
77 | - $this->assertEqual(_EXTCAL_TS_MINUTE,$this->cal->size()); |
|
77 | + $this->assertEqual(_EXTCAL_TS_MINUTE, $this->cal->size()); |
|
78 | 78 | } |
79 | 79 | function testFetch() |
80 | 80 | { |
81 | 81 | $this->cal->build(); |
82 | - $i=0; |
|
83 | - while ( $Child = $this->cal->fetch() ) { |
|
82 | + $i = 0; |
|
83 | + while ($Child = $this->cal->fetch()) { |
|
84 | 84 | ++$i; |
85 | 85 | } |
86 | - $this->assertEqual(_EXTCAL_TS_MINUTE,$i); |
|
86 | + $this->assertEqual(_EXTCAL_TS_MINUTE, $i); |
|
87 | 87 | } |
88 | 88 | function testFetchAll() |
89 | 89 | { |
90 | 90 | $this->cal->build(); |
91 | 91 | $children = array(); |
92 | 92 | $i = 0; |
93 | - while ( $Child = $this->cal->fetch() ) { |
|
94 | - $children[$i]=$Child; |
|
93 | + while ($Child = $this->cal->fetch()) { |
|
94 | + $children[$i] = $Child; |
|
95 | 95 | ++$i; |
96 | 96 | } |
97 | - $this->assertEqual($children,$this->cal->fetchAll()); |
|
97 | + $this->assertEqual($children, $this->cal->fetchAll()); |
|
98 | 98 | } |
99 | 99 | function testSelection() |
100 | 100 | { |
101 | 101 | require_once(CALENDAR_ROOT . 'Minute.php'); |
102 | - $selection = array(new Calendar_Minute(2003,10,25,13,32)); |
|
102 | + $selection = array(new Calendar_Minute(2003, 10, 25, 13, 32)); |
|
103 | 103 | $this->cal->build($selection); |
104 | 104 | $i = 0; |
105 | - while ( $Child = $this->cal->fetch() ) { |
|
106 | - if ( $i == 32 ) |
|
105 | + while ($Child = $this->cal->fetch()) { |
|
106 | + if ($i == 32) |
|
107 | 107 | break; |
108 | 108 | ++$i; |
109 | 109 | } |
@@ -20,27 +20,27 @@ discard block |
||
20 | 20 | } |
21 | 21 | function testGetSecondsInMinute() |
22 | 22 | { |
23 | - $this->assertEqual($this->engine->getSecondsInMinute(),_EXTCAL_TS_MINUTE); |
|
23 | + $this->assertEqual($this->engine->getSecondsInMinute(), _EXTCAL_TS_MINUTE); |
|
24 | 24 | } |
25 | 25 | function testGetMinutesInHour() |
26 | 26 | { |
27 | - $this->assertEqual($this->engine->getMinutesInHour(),_EXTCAL_TS_MINUTE); |
|
27 | + $this->assertEqual($this->engine->getMinutesInHour(), _EXTCAL_TS_MINUTE); |
|
28 | 28 | } |
29 | 29 | function testGetHoursInDay() |
30 | 30 | { |
31 | - $this->assertEqual($this->engine->getHoursInDay(),24); |
|
31 | + $this->assertEqual($this->engine->getHoursInDay(), 24); |
|
32 | 32 | } |
33 | 33 | function testGetFirstDayOfWeek() |
34 | 34 | { |
35 | - $this->assertEqual($this->engine->getFirstDayOfWeek(),1); |
|
35 | + $this->assertEqual($this->engine->getFirstDayOfWeek(), 1); |
|
36 | 36 | } |
37 | 37 | function testGetWeekDays() |
38 | 38 | { |
39 | - $this->assertEqual($this->engine->getWeekDays(),array(0,1,2,3,4,5,6)); |
|
39 | + $this->assertEqual($this->engine->getWeekDays(), array(0, 1, 2, 3, 4, 5, 6)); |
|
40 | 40 | } |
41 | 41 | function testGetDaysInWeek() |
42 | 42 | { |
43 | - $this->assertEqual($this->engine->getDaysInWeek(),7); |
|
43 | + $this->assertEqual($this->engine->getDaysInWeek(), 7); |
|
44 | 44 | } |
45 | 45 | function testGetWeekNInYear() |
46 | 46 | { |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | function testGetWeeksInMonth3() |
66 | 66 | { |
67 | 67 | // Unusual cases that can cause fails (shows up with example 21.php) |
68 | - $this->assertEqual($this->engine->getWeeksInMonth(2004,2,1),5); |
|
69 | - $this->assertEqual($this->engine->getWeeksInMonth(2004,8,1),6); |
|
68 | + $this->assertEqual($this->engine->getWeeksInMonth(2004, 2, 1), 5); |
|
69 | + $this->assertEqual($this->engine->getWeeksInMonth(2004, 8, 1), 6); |
|
70 | 70 | } |
71 | 71 | function testGetDayOfWeek() |
72 | 72 | { |
@@ -74,55 +74,55 @@ discard block |
||
74 | 74 | } |
75 | 75 | function testGetFirstDayInMonth() |
76 | 76 | { |
77 | - $this->assertEqual($this->engine->getFirstDayInMonth(2003,10),3); |
|
77 | + $this->assertEqual($this->engine->getFirstDayInMonth(2003, 10), 3); |
|
78 | 78 | } |
79 | 79 | function testGetDaysInMonth() |
80 | 80 | { |
81 | - $this->assertEqual($this->engine->getDaysInMonth(2003,10),31); |
|
81 | + $this->assertEqual($this->engine->getDaysInMonth(2003, 10), 31); |
|
82 | 82 | } |
83 | 83 | function testGetMinYears() |
84 | 84 | { |
85 | 85 | $test = strpos(PHP_OS, 'WIN') >= 0 ? 1970 : 1902; |
86 | - $this->assertEqual($this->engine->getMinYears(),$test); |
|
86 | + $this->assertEqual($this->engine->getMinYears(), $test); |
|
87 | 87 | } |
88 | 88 | function testGetMaxYears() |
89 | 89 | { |
90 | - $this->assertEqual($this->engine->getMaxYears(),2037); |
|
90 | + $this->assertEqual($this->engine->getMaxYears(), 2037); |
|
91 | 91 | } |
92 | 92 | function testDateToStamp() |
93 | 93 | { |
94 | - $stamp = mktime(0,0,0,10,15,2003); |
|
95 | - $this->assertEqual($this->engine->dateToStamp(2003,10,15,0,0,0),$stamp); |
|
94 | + $stamp = mktime(0, 0, 0, 10, 15, 2003); |
|
95 | + $this->assertEqual($this->engine->dateToStamp(2003, 10, 15, 0, 0, 0), $stamp); |
|
96 | 96 | } |
97 | 97 | function testStampToSecond() |
98 | 98 | { |
99 | - $stamp = mktime(13,30,45,10,15,2003); |
|
100 | - $this->assertEqual($this->engine->stampToSecond($stamp),45); |
|
99 | + $stamp = mktime(13, 30, 45, 10, 15, 2003); |
|
100 | + $this->assertEqual($this->engine->stampToSecond($stamp), 45); |
|
101 | 101 | } |
102 | 102 | function testStampToMinute() |
103 | 103 | { |
104 | - $stamp = mktime(13,30,45,10,15,2003); |
|
105 | - $this->assertEqual($this->engine->stampToMinute($stamp),30); |
|
104 | + $stamp = mktime(13, 30, 45, 10, 15, 2003); |
|
105 | + $this->assertEqual($this->engine->stampToMinute($stamp), 30); |
|
106 | 106 | } |
107 | 107 | function testStampToHour() |
108 | 108 | { |
109 | - $stamp = mktime(13,30,45,10,15,2003); |
|
110 | - $this->assertEqual($this->engine->stampToHour($stamp),13); |
|
109 | + $stamp = mktime(13, 30, 45, 10, 15, 2003); |
|
110 | + $this->assertEqual($this->engine->stampToHour($stamp), 13); |
|
111 | 111 | } |
112 | 112 | function testStampToDay() |
113 | 113 | { |
114 | - $stamp = mktime(13,30,45,10,15,2003); |
|
115 | - $this->assertEqual($this->engine->stampToDay($stamp),15); |
|
114 | + $stamp = mktime(13, 30, 45, 10, 15, 2003); |
|
115 | + $this->assertEqual($this->engine->stampToDay($stamp), 15); |
|
116 | 116 | } |
117 | 117 | function testStampToMonth() |
118 | 118 | { |
119 | - $stamp = mktime(13,30,45,10,15,2003); |
|
120 | - $this->assertEqual($this->engine->stampToMonth($stamp),10); |
|
119 | + $stamp = mktime(13, 30, 45, 10, 15, 2003); |
|
120 | + $this->assertEqual($this->engine->stampToMonth($stamp), 10); |
|
121 | 121 | } |
122 | 122 | function testStampToYear() |
123 | 123 | { |
124 | - $stamp = mktime(13,30,45,10,15,2003); |
|
125 | - $this->assertEqual($this->engine->stampToYear($stamp),2003); |
|
124 | + $stamp = mktime(13, 30, 45, 10, 15, 2003); |
|
125 | + $this->assertEqual($this->engine->stampToYear($stamp), 2003); |
|
126 | 126 | } |
127 | 127 | function testIsToday() |
128 | 128 | { |
@@ -17,9 +17,9 @@ |
||
17 | 17 | } |
18 | 18 | function setUp() |
19 | 19 | { |
20 | - $this->cal = new Calendar_Second(2003,10,25,13,32,43); |
|
20 | + $this->cal = new Calendar_Second(2003, 10, 25, 13, 32, 43); |
|
21 | 21 | } |
22 | - function testPrevDay_Array () |
|
22 | + function testPrevDay_Array() |
|
23 | 23 | { |
24 | 24 | $this->assertEqual( |
25 | 25 | array( |
@@ -4,8 +4,8 @@ discard block |
||
4 | 4 | require_once 'simple_include.php'; |
5 | 5 | require_once 'calendar_include.php'; |
6 | 6 | |
7 | -Mock::generate('Calendar_Day','Mock_Calendar_Day'); |
|
8 | -Mock::generate('Calendar_Engine_Interface','Mock_Calendar_Engine'); |
|
7 | +Mock::generate('Calendar_Day', 'Mock_Calendar_Day'); |
|
8 | +Mock::generate('Calendar_Engine_Interface', 'Mock_Calendar_Engine'); |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Class TestOfUtilUri |
@@ -22,13 +22,13 @@ discard block |
||
22 | 22 | function setUp() |
23 | 23 | { |
24 | 24 | $this->MockCal = new Mock_Calendar_Day($this); |
25 | - $this->MockCal->setReturnValue('getEngine',new Mock_Calendar_Engine($this)); |
|
25 | + $this->MockCal->setReturnValue('getEngine', new Mock_Calendar_Engine($this)); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | function testFragments() |
29 | 29 | { |
30 | - $Uri = new Calendar_Util_Uri('y','m','d','h','m','s'); |
|
31 | - $Uri->setFragments('year','month','day','hour','minute','second'); |
|
30 | + $Uri = new Calendar_Util_Uri('y', 'm', 'd', 'h', 'm', 's'); |
|
31 | + $Uri->setFragments('year', 'month', 'day', 'hour', 'minute', 'second'); |
|
32 | 32 | $this->assertEqual( |
33 | 33 | 'year=&month=&day=&hour=&minute=&second=', |
34 | 34 | $Uri->this($this->MockCal, 'second') |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | } |
37 | 37 | function testScalarFragments() |
38 | 38 | { |
39 | - $Uri = new Calendar_Util_Uri('year','month','day','hour','minute','second'); |
|
39 | + $Uri = new Calendar_Util_Uri('year', 'month', 'day', 'hour', 'minute', 'second'); |
|
40 | 40 | $Uri->scalar = true; |
41 | 41 | $this->assertEqual( |
42 | 42 | '&&&&&', |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | function testSetSeperator() |
47 | 47 | { |
48 | - $Uri = new Calendar_Util_Uri('year','month','day','hour','minute','second'); |
|
48 | + $Uri = new Calendar_Util_Uri('year', 'month', 'day', 'hour', 'minute', 'second'); |
|
49 | 49 | $Uri->separator = '/'; |
50 | 50 | $this->assertEqual( |
51 | 51 | 'year=/month=/day=/hour=/minute=/second=', |
@@ -19,11 +19,11 @@ discard block |
||
19 | 19 | { |
20 | 20 | $this->cal = new Calendar_Month_Weekdays(2003, 10); |
21 | 21 | } |
22 | - function testPrevDay () |
|
22 | + function testPrevDay() |
|
23 | 23 | { |
24 | - $this->assertEqual(30,$this->cal->prevDay()); |
|
24 | + $this->assertEqual(30, $this->cal->prevDay()); |
|
25 | 25 | } |
26 | - function testPrevDay_Array () |
|
26 | + function testPrevDay_Array() |
|
27 | 27 | { |
28 | 28 | $this->assertEqual( |
29 | 29 | array( |
@@ -35,47 +35,47 @@ discard block |
||
35 | 35 | 'second' => 0), |
36 | 36 | $this->cal->prevDay('array')); |
37 | 37 | } |
38 | - function testThisDay () |
|
38 | + function testThisDay() |
|
39 | 39 | { |
40 | 40 | $this->assertEqual(1, $this->cal->thisDay()); |
41 | 41 | } |
42 | - function testNextDay () |
|
42 | + function testNextDay() |
|
43 | 43 | { |
44 | 44 | $this->assertEqual(2, $this->cal->nextDay()); |
45 | 45 | } |
46 | - function testPrevHour () |
|
46 | + function testPrevHour() |
|
47 | 47 | { |
48 | 48 | $this->assertEqual(23, $this->cal->prevHour()); |
49 | 49 | } |
50 | - function testThisHour () |
|
50 | + function testThisHour() |
|
51 | 51 | { |
52 | 52 | $this->assertEqual(0, $this->cal->thisHour()); |
53 | 53 | } |
54 | - function testNextHour () |
|
54 | + function testNextHour() |
|
55 | 55 | { |
56 | 56 | $this->assertEqual(1, $this->cal->nextHour()); |
57 | 57 | } |
58 | - function testPrevMinute () |
|
58 | + function testPrevMinute() |
|
59 | 59 | { |
60 | 60 | $this->assertEqual(59, $this->cal->prevMinute()); |
61 | 61 | } |
62 | - function testThisMinute () |
|
62 | + function testThisMinute() |
|
63 | 63 | { |
64 | 64 | $this->assertEqual(0, $this->cal->thisMinute()); |
65 | 65 | } |
66 | - function testNextMinute () |
|
66 | + function testNextMinute() |
|
67 | 67 | { |
68 | 68 | $this->assertEqual(1, $this->cal->nextMinute()); |
69 | 69 | } |
70 | - function testPrevSecond () |
|
70 | + function testPrevSecond() |
|
71 | 71 | { |
72 | 72 | $this->assertEqual(59, $this->cal->prevSecond()); |
73 | 73 | } |
74 | - function testThisSecond () |
|
74 | + function testThisSecond() |
|
75 | 75 | { |
76 | 76 | $this->assertEqual(0, $this->cal->thisSecond()); |
77 | 77 | } |
78 | - function testNextSecond () |
|
78 | + function testNextSecond() |
|
79 | 79 | { |
80 | 80 | $this->assertEqual(1, $this->cal->nextSecond()); |
81 | 81 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | function testFetch() |
104 | 104 | { |
105 | 105 | $this->cal->build(); |
106 | - $i=0; |
|
106 | + $i = 0; |
|
107 | 107 | while ($Child = $this->cal->fetch()) { |
108 | 108 | ++$i; |
109 | 109 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $children[$i] = $Child; |
119 | 119 | ++$i; |
120 | 120 | } |
121 | - $this->assertEqual($children,$this->cal->fetchAll()); |
|
121 | + $this->assertEqual($children, $this->cal->fetchAll()); |
|
122 | 122 | } |
123 | 123 | function testSelection() |
124 | 124 | { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | } |
151 | 151 | function testEmptyCount2() |
152 | 152 | { |
153 | - $this->cal = new Calendar_Month_Weekdays(2010,3); |
|
153 | + $this->cal = new Calendar_Month_Weekdays(2010, 3); |
|
154 | 154 | $this->cal->build(); |
155 | 155 | $empty = 0; |
156 | 156 | while ($Child = $this->cal->fetch()) { |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | } |
163 | 163 | function testEmptyCount3() |
164 | 164 | { |
165 | - $this->cal = new Calendar_Month_Weekdays(2010,6); |
|
165 | + $this->cal = new Calendar_Month_Weekdays(2010, 6); |
|
166 | 166 | $this->cal->build(); |
167 | 167 | $empty = 0; |
168 | 168 | while ($Child = $this->cal->fetch()) { |
@@ -4,8 +4,8 @@ discard block |
||
4 | 4 | require_once 'simple_include.php'; |
5 | 5 | require_once 'calendar_include.php'; |
6 | 6 | |
7 | -Mock::generate('Calendar_Engine_Interface','Mock_Calendar_Engine'); |
|
8 | -Mock::generate('Calendar_Second','Mock_Calendar_Second'); |
|
7 | +Mock::generate('Calendar_Engine_Interface', 'Mock_Calendar_Engine'); |
|
8 | +Mock::generate('Calendar_Second', 'Mock_Calendar_Second'); |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Class TestOfValidator |
@@ -21,15 +21,15 @@ discard block |
||
21 | 21 | function setUp() |
22 | 22 | { |
23 | 23 | $this->mockengine = new Mock_Calendar_Engine($this); |
24 | - $this->mockengine->setReturnValue('getMinYears',1970); |
|
25 | - $this->mockengine->setReturnValue('getMaxYears',2037); |
|
26 | - $this->mockengine->setReturnValue('getMonthsInYear',12); |
|
27 | - $this->mockengine->setReturnValue('getDaysInMonth',30); |
|
28 | - $this->mockengine->setReturnValue('getHoursInDay',24); |
|
29 | - $this->mockengine->setReturnValue('getMinutesInHour',_EXTCAL_TS_MINUTE); |
|
30 | - $this->mockengine->setReturnValue('getSecondsInMinute',_EXTCAL_TS_MINUTE); |
|
24 | + $this->mockengine->setReturnValue('getMinYears', 1970); |
|
25 | + $this->mockengine->setReturnValue('getMaxYears', 2037); |
|
26 | + $this->mockengine->setReturnValue('getMonthsInYear', 12); |
|
27 | + $this->mockengine->setReturnValue('getDaysInMonth', 30); |
|
28 | + $this->mockengine->setReturnValue('getHoursInDay', 24); |
|
29 | + $this->mockengine->setReturnValue('getMinutesInHour', _EXTCAL_TS_MINUTE); |
|
30 | + $this->mockengine->setReturnValue('getSecondsInMinute', _EXTCAL_TS_MINUTE); |
|
31 | 31 | $this->mockcal = new Mock_Calendar_Second($this); |
32 | - $this->mockcal->setReturnValue('getEngine',$this->mockengine); |
|
32 | + $this->mockcal->setReturnValue('getEngine', $this->mockengine); |
|
33 | 33 | } |
34 | 34 | function tearDown() |
35 | 35 | { |
@@ -38,139 +38,139 @@ discard block |
||
38 | 38 | } |
39 | 39 | function testIsValidYear() |
40 | 40 | { |
41 | - $this->mockcal->setReturnValue('thisYear',2000); |
|
41 | + $this->mockcal->setReturnValue('thisYear', 2000); |
|
42 | 42 | $Validator = new Calendar_Validator($this->mockcal); |
43 | 43 | $this->assertTrue($Validator->isValidYear()); |
44 | 44 | } |
45 | 45 | function testIsValidYearTooSmall() |
46 | 46 | { |
47 | - $this->mockcal->setReturnValue('thisYear',1969); |
|
47 | + $this->mockcal->setReturnValue('thisYear', 1969); |
|
48 | 48 | $Validator = new Calendar_Validator($this->mockcal); |
49 | 49 | $this->assertFalse($Validator->isValidYear()); |
50 | 50 | } |
51 | 51 | function testIsValidYearTooLarge() |
52 | 52 | { |
53 | - $this->mockcal->setReturnValue('thisYear',2038); |
|
53 | + $this->mockcal->setReturnValue('thisYear', 2038); |
|
54 | 54 | $Validator = new Calendar_Validator($this->mockcal); |
55 | 55 | $this->assertFalse($Validator->isValidYear()); |
56 | 56 | } |
57 | 57 | function testIsValidMonth() |
58 | 58 | { |
59 | - $this->mockcal->setReturnValue('thisMonth',10); |
|
59 | + $this->mockcal->setReturnValue('thisMonth', 10); |
|
60 | 60 | $Validator = new Calendar_Validator($this->mockcal); |
61 | 61 | $this->assertTrue($Validator->isValidMonth()); |
62 | 62 | } |
63 | 63 | function testIsValidMonthTooSmall() |
64 | 64 | { |
65 | - $this->mockcal->setReturnValue('thisMonth',0); |
|
65 | + $this->mockcal->setReturnValue('thisMonth', 0); |
|
66 | 66 | $Validator = new Calendar_Validator($this->mockcal); |
67 | 67 | $this->assertFalse($Validator->isValidMonth()); |
68 | 68 | } |
69 | 69 | function testIsValidMonthTooLarge() |
70 | 70 | { |
71 | - $this->mockcal->setReturnValue('thisMonth',13); |
|
71 | + $this->mockcal->setReturnValue('thisMonth', 13); |
|
72 | 72 | $Validator = new Calendar_Validator($this->mockcal); |
73 | 73 | $this->assertFalse($Validator->isValidMonth()); |
74 | 74 | } |
75 | 75 | function testIsValidDay() |
76 | 76 | { |
77 | - $this->mockcal->setReturnValue('thisDay',10); |
|
77 | + $this->mockcal->setReturnValue('thisDay', 10); |
|
78 | 78 | $Validator = new Calendar_Validator($this->mockcal); |
79 | 79 | $this->assertTrue($Validator->isValidDay()); |
80 | 80 | } |
81 | 81 | function testIsValidDayTooSmall() |
82 | 82 | { |
83 | - $this->mockcal->setReturnValue('thisDay',0); |
|
83 | + $this->mockcal->setReturnValue('thisDay', 0); |
|
84 | 84 | $Validator = new Calendar_Validator($this->mockcal); |
85 | 85 | $this->assertFalse($Validator->isValidDay()); |
86 | 86 | } |
87 | 87 | function testIsValidDayTooLarge() |
88 | 88 | { |
89 | - $this->mockcal->setReturnValue('thisDay',31); |
|
89 | + $this->mockcal->setReturnValue('thisDay', 31); |
|
90 | 90 | $Validator = new Calendar_Validator($this->mockcal); |
91 | 91 | $this->assertFalse($Validator->isValidDay()); |
92 | 92 | } |
93 | 93 | function testIsValidHour() |
94 | 94 | { |
95 | - $this->mockcal->setReturnValue('thisHour',10); |
|
95 | + $this->mockcal->setReturnValue('thisHour', 10); |
|
96 | 96 | $Validator = new Calendar_Validator($this->mockcal); |
97 | 97 | $this->assertTrue($Validator->isValidHour()); |
98 | 98 | } |
99 | 99 | function testIsValidHourTooSmall() |
100 | 100 | { |
101 | - $this->mockcal->setReturnValue('thisHour',-1); |
|
101 | + $this->mockcal->setReturnValue('thisHour', -1); |
|
102 | 102 | $Validator = new Calendar_Validator($this->mockcal); |
103 | 103 | $this->assertFalse($Validator->isValidHour()); |
104 | 104 | } |
105 | 105 | function testIsValidHourTooLarge() |
106 | 106 | { |
107 | - $this->mockcal->setReturnValue('thisHour',24); |
|
107 | + $this->mockcal->setReturnValue('thisHour', 24); |
|
108 | 108 | $Validator = new Calendar_Validator($this->mockcal); |
109 | 109 | $this->assertFalse($Validator->isValidHour()); |
110 | 110 | } |
111 | 111 | function testIsValidMinute() |
112 | 112 | { |
113 | - $this->mockcal->setReturnValue('thisMinute',30); |
|
113 | + $this->mockcal->setReturnValue('thisMinute', 30); |
|
114 | 114 | $Validator = new Calendar_Validator($this->mockcal); |
115 | 115 | $this->assertTrue($Validator->isValidMinute()); |
116 | 116 | } |
117 | 117 | function testIsValidMinuteTooSmall() |
118 | 118 | { |
119 | - $this->mockcal->setReturnValue('thisMinute',-1); |
|
119 | + $this->mockcal->setReturnValue('thisMinute', -1); |
|
120 | 120 | $Validator = new Calendar_Validator($this->mockcal); |
121 | 121 | $this->assertFalse($Validator->isValidMinute()); |
122 | 122 | } |
123 | 123 | function testIsValidMinuteTooLarge() |
124 | 124 | { |
125 | - $this->mockcal->setReturnValue('thisMinute',_EXTCAL_TS_MINUTE); |
|
125 | + $this->mockcal->setReturnValue('thisMinute', _EXTCAL_TS_MINUTE); |
|
126 | 126 | $Validator = new Calendar_Validator($this->mockcal); |
127 | 127 | $this->assertFalse($Validator->isValidMinute()); |
128 | 128 | } |
129 | 129 | function testIsValidSecond() |
130 | 130 | { |
131 | - $this->mockcal->setReturnValue('thisSecond',30); |
|
131 | + $this->mockcal->setReturnValue('thisSecond', 30); |
|
132 | 132 | $Validator = new Calendar_Validator($this->mockcal); |
133 | 133 | $this->assertTrue($Validator->isValidSecond()); |
134 | 134 | } |
135 | 135 | function testIsValidSecondTooSmall() |
136 | 136 | { |
137 | - $this->mockcal->setReturnValue('thisSecond',-1); |
|
137 | + $this->mockcal->setReturnValue('thisSecond', -1); |
|
138 | 138 | $Validator = new Calendar_Validator($this->mockcal); |
139 | 139 | $this->assertFalse($Validator->isValidSecond()); |
140 | 140 | } |
141 | 141 | function testIsValidSecondTooLarge() |
142 | 142 | { |
143 | - $this->mockcal->setReturnValue('thisSecond',_EXTCAL_TS_MINUTE); |
|
143 | + $this->mockcal->setReturnValue('thisSecond', _EXTCAL_TS_MINUTE); |
|
144 | 144 | $Validator = new Calendar_Validator($this->mockcal); |
145 | 145 | $this->assertFalse($Validator->isValidSecond()); |
146 | 146 | } |
147 | 147 | function testIsValid() |
148 | 148 | { |
149 | - $this->mockcal->setReturnValue('thisYear',2000); |
|
150 | - $this->mockcal->setReturnValue('thisMonth',5); |
|
151 | - $this->mockcal->setReturnValue('thisDay',15); |
|
152 | - $this->mockcal->setReturnValue('thisHour',13); |
|
153 | - $this->mockcal->setReturnValue('thisMinute',30); |
|
154 | - $this->mockcal->setReturnValue('thisSecond',40); |
|
149 | + $this->mockcal->setReturnValue('thisYear', 2000); |
|
150 | + $this->mockcal->setReturnValue('thisMonth', 5); |
|
151 | + $this->mockcal->setReturnValue('thisDay', 15); |
|
152 | + $this->mockcal->setReturnValue('thisHour', 13); |
|
153 | + $this->mockcal->setReturnValue('thisMinute', 30); |
|
154 | + $this->mockcal->setReturnValue('thisSecond', 40); |
|
155 | 155 | $Validator = new Calendar_Validator($this->mockcal); |
156 | 156 | $this->assertTrue($Validator->isValid()); |
157 | 157 | } |
158 | 158 | function testIsValidAllWrong() |
159 | 159 | { |
160 | - $this->mockcal->setReturnValue('thisYear',2038); |
|
161 | - $this->mockcal->setReturnValue('thisMonth',13); |
|
162 | - $this->mockcal->setReturnValue('thisDay',31); |
|
160 | + $this->mockcal->setReturnValue('thisYear', 2038); |
|
161 | + $this->mockcal->setReturnValue('thisMonth', 13); |
|
162 | + $this->mockcal->setReturnValue('thisDay', 31); |
|
163 | 163 | $this->mockcal->day = 31; |
164 | - $this->mockcal->setReturnValue('thisHour',24); |
|
165 | - $this->mockcal->setReturnValue('thisMinute',_EXTCAL_TS_MINUTE); |
|
166 | - $this->mockcal->setReturnValue('thisSecond',_EXTCAL_TS_MINUTE); |
|
164 | + $this->mockcal->setReturnValue('thisHour', 24); |
|
165 | + $this->mockcal->setReturnValue('thisMinute', _EXTCAL_TS_MINUTE); |
|
166 | + $this->mockcal->setReturnValue('thisSecond', _EXTCAL_TS_MINUTE); |
|
167 | 167 | $Validator = new Calendar_Validator($this->mockcal); |
168 | 168 | $this->assertFalse($Validator->isValid()); |
169 | 169 | $i = 0; |
170 | - while ( $Validator->fetch() ) { |
|
170 | + while ($Validator->fetch()) { |
|
171 | 171 | ++$i; |
172 | 172 | } |
173 | - $this->assertEqual($i,6); |
|
173 | + $this->assertEqual($i, 6); |
|
174 | 174 | } |
175 | 175 | } |
176 | 176 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | } |
192 | 192 | function testMonth() |
193 | 193 | { |
194 | - $Unit = new Calendar_Month(2000,13); |
|
194 | + $Unit = new Calendar_Month(2000, 13); |
|
195 | 195 | $Validator = & $Unit->getValidator(); |
196 | 196 | $this->assertFalse($Validator->isValidMonth()); |
197 | 197 | } |
@@ -205,38 +205,38 @@ discard block |
||
205 | 205 | */ |
206 | 206 | function testDay() |
207 | 207 | { |
208 | - $Unit = new Calendar_Day(2000,12,32); |
|
208 | + $Unit = new Calendar_Day(2000, 12, 32); |
|
209 | 209 | $Validator = & $Unit->getValidator(); |
210 | 210 | $this->assertFalse($Validator->isValidDay()); |
211 | 211 | } |
212 | 212 | function testHour() |
213 | 213 | { |
214 | - $Unit = new Calendar_Hour(2000,12,20,24); |
|
214 | + $Unit = new Calendar_Hour(2000, 12, 20, 24); |
|
215 | 215 | $Validator = & $Unit->getValidator(); |
216 | 216 | $this->assertFalse($Validator->isValidHour()); |
217 | 217 | } |
218 | 218 | function testMinute() |
219 | 219 | { |
220 | - $Unit = new Calendar_Minute(2000,12,20,23,_EXTCAL_TS_MINUTE); |
|
220 | + $Unit = new Calendar_Minute(2000, 12, 20, 23, _EXTCAL_TS_MINUTE); |
|
221 | 221 | $Validator = & $Unit->getValidator(); |
222 | 222 | $this->assertFalse($Validator->isValidMinute()); |
223 | 223 | } |
224 | 224 | function testSecond() |
225 | 225 | { |
226 | - $Unit = new Calendar_Second(2000,12,20,23,59,_EXTCAL_TS_MINUTE); |
|
226 | + $Unit = new Calendar_Second(2000, 12, 20, 23, 59, _EXTCAL_TS_MINUTE); |
|
227 | 227 | $Validator = & $Unit->getValidator(); |
228 | 228 | $this->assertFalse($Validator->isValidSecond()); |
229 | 229 | } |
230 | 230 | function testAllBad() |
231 | 231 | { |
232 | - $Unit = new Calendar_Second(2000,13,32,24,_EXTCAL_TS_MINUTE,_EXTCAL_TS_MINUTE); |
|
232 | + $Unit = new Calendar_Second(2000, 13, 32, 24, _EXTCAL_TS_MINUTE, _EXTCAL_TS_MINUTE); |
|
233 | 233 | $this->assertFalse($Unit->isValid()); |
234 | 234 | $Validator = & $Unit->getValidator(); |
235 | 235 | $i = 0; |
236 | - while ( $Validator->fetch() ) { |
|
236 | + while ($Validator->fetch()) { |
|
237 | 237 | ++$i; |
238 | 238 | } |
239 | - $this->assertEqual($i,5); |
|
239 | + $this->assertEqual($i, 5); |
|
240 | 240 | } |
241 | 241 | } |
242 | 242 |
@@ -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.'Decorator/Uri.php'; |
|
8 | +require_once CALENDAR_ROOT . 'Month/Weekdays.php'; |
|
9 | +require_once CALENDAR_ROOT . 'Decorator/Uri.php'; |
|
10 | 10 | |
11 | 11 | if (!isset($_GET['jahr'])) $_GET['jahr'] = date('Y'); |
12 | 12 | if (!isset($_GET['monat'])) $_GET['monat'] = date('m'); |
@@ -14,18 +14,18 @@ discard block |
||
14 | 14 | // Build the month |
15 | 15 | $Calendar = new Calendar_Month_Weekdays($_GET['jahr'], $_GET['monat']); |
16 | 16 | |
17 | -echo ( '<p>The current month is ' |
|
18 | - .$Calendar->thisMonth().' of year '.$Calendar->thisYear().'</p>'); |
|
17 | +echo ('<p>The current month is ' |
|
18 | + .$Calendar->thisMonth() . ' of year ' . $Calendar->thisYear() . '</p>'); |
|
19 | 19 | |
20 | 20 | $Uri = new Calendar_Decorator_Uri($Calendar); |
21 | -$Uri->setFragments('jahr','monat'); |
|
21 | +$Uri->setFragments('jahr', 'monat'); |
|
22 | 22 | // $Uri->setSeperator('/'); // Default is & |
23 | 23 | // $Uri->setScalar(); // Omit variable names |
24 | -echo ( "<pre>Previous Uri:\t".$Uri->prev('month')."\n" ); |
|
25 | -echo ( "This Uri:\t".$Uri->this('month')."\n" ); |
|
26 | -echo ( "Next Uri:\t".$Uri->next('month')."\n</pre>" ); |
|
24 | +echo ("<pre>Previous Uri:\t" . $Uri->prev('month') . "\n"); |
|
25 | +echo ("This Uri:\t" . $Uri->this('month') . "\n"); |
|
26 | +echo ("Next Uri:\t" . $Uri->next('month') . "\n</pre>"); |
|
27 | 27 | ?> |
28 | 28 | <p> |
29 | -<a href="<?php echo($_SERVER['PHP_SELF'].'?'.$Uri->prev('month'));?>">Prev</a> : |
|
30 | -<a href="<?php echo($_SERVER['PHP_SELF'].'?'.$Uri->next('month'));?>">Next</a> |
|
29 | +<a href="<?php echo($_SERVER['PHP_SELF'] . '?' . $Uri->prev('month')); ?>">Prev</a> : |
|
30 | +<a href="<?php echo($_SERVER['PHP_SELF'] . '?' . $Uri->next('month')); ?>">Next</a> |
|
31 | 31 | </p> |
@@ -7,13 +7,13 @@ discard block |
||
7 | 7 | */ |
8 | 8 | function getmicrotime() |
9 | 9 | { |
10 | - list($usec, $sec) = explode(" ",microtime()); |
|
10 | + list($usec, $sec) = explode(" ", microtime()); |
|
11 | 11 | |
12 | 12 | return ((float) $usec + (float) $sec); |
13 | 13 | } |
14 | 14 | |
15 | 15 | if (!@include 'Calendar/Calendar.php') { |
16 | - define('CALENDAR_ROOT','../../'); |
|
16 | + define('CALENDAR_ROOT', '../../'); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | if (!isset($_GET['y'])) $_GET['y'] = 2003; |
@@ -27,67 +27,67 @@ discard block |
||
27 | 27 | default: |
28 | 28 | $_GET['view'] = 'calendar_year'; |
29 | 29 | case 'calendar_year': |
30 | - require_once CALENDAR_ROOT.'Year.php'; |
|
30 | + require_once CALENDAR_ROOT . 'Year.php'; |
|
31 | 31 | $c = new Calendar_Year($_GET['y']); |
32 | 32 | break; |
33 | 33 | case 'calendar_month': |
34 | - require_once CALENDAR_ROOT.'Month.php'; |
|
35 | - $c = new Calendar_Month($_GET['y'],$_GET['m']); |
|
34 | + require_once CALENDAR_ROOT . 'Month.php'; |
|
35 | + $c = new Calendar_Month($_GET['y'], $_GET['m']); |
|
36 | 36 | break; |
37 | 37 | case 'calendar_day': |
38 | - require_once CALENDAR_ROOT.'Day.php'; |
|
39 | - $c = new Calendar_Day($_GET['y'],$_GET['m'],$_GET['d']); |
|
38 | + require_once CALENDAR_ROOT . 'Day.php'; |
|
39 | + $c = new Calendar_Day($_GET['y'], $_GET['m'], $_GET['d']); |
|
40 | 40 | break; |
41 | 41 | case 'calendar_hour': |
42 | - require_once CALENDAR_ROOT.'Hour.php'; |
|
43 | - $c = new Calendar_Hour($_GET['y'],$_GET['m'],$_GET['d'],$_GET['h']); |
|
42 | + require_once CALENDAR_ROOT . 'Hour.php'; |
|
43 | + $c = new Calendar_Hour($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h']); |
|
44 | 44 | break; |
45 | 45 | case 'calendar_minute': |
46 | - require_once CALENDAR_ROOT.'Minute.php'; |
|
47 | - $c = new Calendar_Minute($_GET['y'],$_GET['m'],$_GET['d'],$_GET['h'],$_GET['i']); |
|
46 | + require_once CALENDAR_ROOT . 'Minute.php'; |
|
47 | + $c = new Calendar_Minute($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i']); |
|
48 | 48 | break; |
49 | 49 | case 'calendar_second': |
50 | - require_once CALENDAR_ROOT.'Second.php'; |
|
51 | - $c = new Calendar_Second($_GET['y'],$_GET['m'],$_GET['d'],$_GET['h'],$_GET['i'],$_GET['s']); |
|
50 | + require_once CALENDAR_ROOT . 'Second.php'; |
|
51 | + $c = new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']); |
|
52 | 52 | break; |
53 | 53 | } |
54 | 54 | |
55 | -echo ( 'Viewing: '.@$_GET['view'].'<br />' ); |
|
56 | -echo ( 'The time is now: '.date('Y M d H:i:s',$c->getTimestamp()).'<br >' ); |
|
55 | +echo ('Viewing: ' . @$_GET['view'] . '<br />'); |
|
56 | +echo ('The time is now: ' . date('Y M d H:i:s', $c->getTimestamp()) . '<br >'); |
|
57 | 57 | |
58 | 58 | $i = 1; |
59 | -echo ( '<h1>First Iteration</h1>' ); |
|
60 | -echo ( '<p>The first iteration is more "expensive", the calendar data |
|
59 | +echo ('<h1>First Iteration</h1>'); |
|
60 | +echo ('<p>The first iteration is more "expensive", the calendar data |
|
61 | 61 | structures having to be built.</p>' ); |
62 | 62 | $start = getmicrotime(); |
63 | 63 | $c->build(); |
64 | -while ( $e = $c->fetch() ) { |
|
64 | +while ($e = $c->fetch()) { |
|
65 | 65 | $class = strtolower(get_class($e)); |
66 | - $link ="&y=".$e->thisYear()."&m=".$e->thisMonth()."&d=".$e->thisDay(). |
|
67 | - "&h=".$e->thisHour()."&i=".$e->thisMinute()."&s=".$e->thisSecond(); |
|
68 | - $method = 'this'.str_replace('calendar_','',$class); |
|
69 | - echo ( "<a href=\"".$_SERVER['PHP_SELF']."?view=".$class.$link."\">".$e->{$method}()."</a> : " ); |
|
70 | - if ( ($i % 10) == 0 ) { |
|
71 | - echo ( '<br>' ); |
|
66 | + $link = "&y=" . $e->thisYear() . "&m=" . $e->thisMonth() . "&d=" . $e->thisDay() . |
|
67 | + "&h=" . $e->thisHour() . "&i=" . $e->thisMinute() . "&s=" . $e->thisSecond(); |
|
68 | + $method = 'this' . str_replace('calendar_', '', $class); |
|
69 | + echo ("<a href=\"" . $_SERVER['PHP_SELF'] . "?view=" . $class . $link . "\">" . $e->{$method}() . "</a> : "); |
|
70 | + if (($i % 10) == 0) { |
|
71 | + echo ('<br>'); |
|
72 | 72 | } |
73 | 73 | ++$i; |
74 | 74 | } |
75 | -echo ( '<p><b>Took: '.(getmicrotime()-$start).' seconds</b></p>' ); |
|
75 | +echo ('<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'); |
|
76 | 76 | |
77 | 77 | $i = 1; |
78 | -echo ( '<h1>Second Iteration</h1>' ); |
|
79 | -echo ( '<p>This second iteration is faster, the data structures |
|
78 | +echo ('<h1>Second Iteration</h1>'); |
|
79 | +echo ('<p>This second iteration is faster, the data structures |
|
80 | 80 | being re-used</p>' ); |
81 | 81 | $start = getmicrotime(); |
82 | -while ( $e = $c->fetch() ) { |
|
82 | +while ($e = $c->fetch()) { |
|
83 | 83 | $class = strtolower(get_class($e)); |
84 | - $link ="&y=".$e->thisYear()."&m=".$e->thisMonth()."&d=".$e->thisDay(). |
|
85 | - "&h=".$e->thisHour()."&i=".$e->thisMinute()."&s=".$e->thisSecond(); |
|
86 | - $method = 'this'.str_replace('calendar_','',$class); |
|
87 | - echo ( "<a href=\"".$_SERVER['PHP_SELF']."?view=".$class.$link."\">".$e->{$method}()."</a> : " ); |
|
88 | - if ( ($i % 10) == 0 ) { |
|
89 | - echo ( '<br>' ); |
|
84 | + $link = "&y=" . $e->thisYear() . "&m=" . $e->thisMonth() . "&d=" . $e->thisDay() . |
|
85 | + "&h=" . $e->thisHour() . "&i=" . $e->thisMinute() . "&s=" . $e->thisSecond(); |
|
86 | + $method = 'this' . str_replace('calendar_', '', $class); |
|
87 | + echo ("<a href=\"" . $_SERVER['PHP_SELF'] . "?view=" . $class . $link . "\">" . $e->{$method}() . "</a> : "); |
|
88 | + if (($i % 10) == 0) { |
|
89 | + echo ('<br>'); |
|
90 | 90 | } |
91 | 91 | ++$i; |
92 | 92 | } |
93 | -echo ( '<p><b>Took: '.(getmicrotime()-$start).' seconds</b></p>' ); |
|
93 | +echo ('<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'); |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | /** |
3 | 3 | * Description: client for the SOAP Calendar Server |
4 | 4 | */ |
5 | -if ( version_compare(phpversion(), "5.0.0", ">") ) { |
|
5 | +if (version_compare(phpversion(), "5.0.0", ">")) { |
|
6 | 6 | die('PHP 5 has problems with PEAR::SOAP Client (8.0RC3) |
7 | 7 | - remove @ before include below to see why'); |
8 | 8 | } |
@@ -15,21 +15,21 @@ discard block |
||
15 | 15 | $basePath = explode('/', $_SERVER['SCRIPT_NAME']); |
16 | 16 | array_pop($basePath); |
17 | 17 | $basePath = implode('/', $basePath); |
18 | -$url = 'http://'.$_SERVER['SERVER_NAME'].$basePath.'/7.php?wsdl'; |
|
18 | +$url = 'http://' . $_SERVER['SERVER_NAME'] . $basePath . '/7.php?wsdl'; |
|
19 | 19 | |
20 | 20 | if (!isset($_GET['y'])) $_GET['y'] = date('Y'); |
21 | 21 | if (!isset($_GET['m'])) $_GET['m'] = date('n'); |
22 | 22 | |
23 | -$wsdl = new SOAP_WSDL ($url); |
|
23 | +$wsdl = new SOAP_WSDL($url); |
|
24 | 24 | |
25 | -echo ( '<pre>'.$wsdl->generateProxyCode().'</pre>' ); |
|
25 | +echo ('<pre>' . $wsdl->generateProxyCode() . '</pre>'); |
|
26 | 26 | |
27 | 27 | $calendarClient = $wsdl->getProxy(); |
28 | 28 | |
29 | -$month = $calendarClient->getMonth((int) $_GET['y'],(int) $_GET['m']); |
|
29 | +$month = $calendarClient->getMonth((int) $_GET['y'], (int) $_GET['m']); |
|
30 | 30 | |
31 | -if ( PEAR::isError($month) ) { |
|
32 | - die ( $month->toString() ); |
|
31 | +if (PEAR::isError($month)) { |
|
32 | + die ($month->toString()); |
|
33 | 33 | } |
34 | 34 | ?> |
35 | 35 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
@@ -40,30 +40,30 @@ discard block |
||
40 | 40 | <body> |
41 | 41 | <h1>Calendar Over the Wire (featuring PEAR::SOAP)</h1> |
42 | 42 | <table> |
43 | -<caption><b><?php echo ( $month->monthname );?></b></caption> |
|
43 | +<caption><b><?php echo ($month->monthname); ?></b></caption> |
|
44 | 44 | <tr> |
45 | 45 | <th>M</th><th>T</th><th>W</th><th>T</th><th>F</th><th>S</th><th>S</th> |
46 | 46 | </tr> |
47 | 47 | <?php |
48 | 48 | foreach ($month->days as $day) { |
49 | 49 | |
50 | - if ( $day->isFirst === 1 ) |
|
51 | - echo ( "<tr>\n" ); |
|
50 | + if ($day->isFirst === 1) |
|
51 | + echo ("<tr>\n"); |
|
52 | 52 | if ($day->isEmpty === 1) { |
53 | - echo ( "<td></td>" ); |
|
53 | + echo ("<td></td>"); |
|
54 | 54 | } else { |
55 | - echo ( "<td>".$day->day."</td>" ); |
|
55 | + echo ("<td>" . $day->day . "</td>"); |
|
56 | 56 | } |
57 | - if ( $day->isLast === 1 ) |
|
58 | - echo ( "</tr>\n" ); |
|
57 | + if ($day->isLast === 1) |
|
58 | + echo ("</tr>\n"); |
|
59 | 59 | } |
60 | 60 | ?> |
61 | 61 | <tr> |
62 | 62 | </table> |
63 | 63 | <p>Enter Year and Month to View:</p> |
64 | -<form action="<?php echo ( $_SERVER['PHP_SELF'] ); ?>" method="get"> |
|
65 | -Year: <input type="text" size="4" name="y" value="<?php echo ( $_GET['y'] ); ?>"> |
|
66 | -Month: <input type="text" size="2" name="m" value="<?php echo ( $_GET['m'] ); ?>"> |
|
64 | +<form action="<?php echo ($_SERVER['PHP_SELF']); ?>" method="get"> |
|
65 | +Year: <input type="text" size="4" name="y" value="<?php echo ($_GET['y']); ?>"> |
|
66 | +Month: <input type="text" size="2" name="m" value="<?php echo ($_GET['m']); ?>"> |
|
67 | 67 | <input type="submit" value="Fetch Calendar"> |
68 | 68 | </form> |
69 | 69 | </body> |