@@ -70,7 +70,7 @@ |
||
70 | 70 | * Send the content type header and the right file extension in front of the content |
71 | 71 | * |
72 | 72 | * @param $contentType |
73 | - * @param $fileExtension |
|
73 | + * @param string $fileExtension |
|
74 | 74 | */ |
75 | 75 | protected function sendHeaderAndFilename($contentType, $fileExtension) |
76 | 76 | { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * Find List |
104 | 104 | * |
105 | 105 | * @param int $limit |
106 | - * @param int|string $listStartTime |
|
106 | + * @param integer $listStartTime |
|
107 | 107 | * @param int $startOffsetHours |
108 | 108 | * @param int $overrideStartDate |
109 | 109 | * @param int $overrideEndDate |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | * Find by traversing information |
185 | 185 | * |
186 | 186 | * @param Index $index |
187 | - * @param bool|true $future |
|
187 | + * @param boolean $future |
|
188 | 188 | * @param bool|false $past |
189 | 189 | * @param int $limit |
190 | 190 | * @param string $sort |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * @param string $calendarUri |
137 | 137 | * @param array $properties |
138 | 138 | * |
139 | - * @return mixed |
|
139 | + * @return string |
|
140 | 140 | * @throws Sabre_DAV_Exception |
141 | 141 | */ |
142 | 142 | public function createCalendar($principalUri, $calendarUri, array $properties) |
@@ -491,9 +491,9 @@ discard block |
||
491 | 491 | /** |
492 | 492 | * Update cal event |
493 | 493 | * |
494 | - * @param $calendarId |
|
495 | - * @param $objectUri |
|
496 | - * @param $calendarData |
|
494 | + * @param string $calendarId |
|
495 | + * @param string $objectUri |
|
496 | + * @param string $calendarData |
|
497 | 497 | */ |
498 | 498 | private function updateCalEvent($calendarId, $objectUri, $calendarData) |
499 | 499 | { |
@@ -129,7 +129,7 @@ |
||
129 | 129 | * |
130 | 130 | * @param $principal |
131 | 131 | * |
132 | - * @return array |
|
132 | + * @return string[] |
|
133 | 133 | * @throws Exception |
134 | 134 | */ |
135 | 135 | public function getGroupMemberSet($principal) |
@@ -44,7 +44,7 @@ |
||
44 | 44 | * Add one row to the table |
45 | 45 | * |
46 | 46 | * @param string $label |
47 | - * @param mixed $value |
|
47 | + * @param string $value |
|
48 | 48 | */ |
49 | 49 | public function addRow($label, $value) |
50 | 50 | { |
@@ -74,6 +74,7 @@ |
||
74 | 74 | /** |
75 | 75 | * Get the times |
76 | 76 | * |
77 | + * @param integer $pageUid |
|
77 | 78 | * @return array |
78 | 79 | */ |
79 | 80 | protected function getTimes($pageUid) |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * |
29 | 29 | * @param string $className |
30 | 30 | * |
31 | - * @return object |
|
31 | + * @return integer |
|
32 | 32 | */ |
33 | 33 | public static function create($className) |
34 | 34 | { |
@@ -16,6 +16,9 @@ |
||
16 | 16 | protected $properties; |
17 | 17 | protected $values; |
18 | 18 | |
19 | + /** |
|
20 | + * @param string $properties |
|
21 | + */ |
|
19 | 22 | function __construct($values, $properties) |
20 | 23 | { |
21 | 24 | $this->properties = $properties; |
@@ -13,30 +13,30 @@ |
||
13 | 13 | class ICalExDate |
14 | 14 | { |
15 | 15 | |
16 | - protected $properties; |
|
17 | - protected $values; |
|
18 | - |
|
19 | - function __construct($values, $properties) |
|
20 | - { |
|
21 | - $this->properties = $properties; |
|
22 | - $this->values = $values; |
|
23 | - } |
|
24 | - |
|
25 | - /** |
|
26 | - * @return mixed |
|
27 | - */ |
|
28 | - public function getProperties() |
|
29 | - { |
|
30 | - return $this->properties; |
|
31 | - } |
|
32 | - |
|
33 | - /** |
|
34 | - * @return mixed |
|
35 | - */ |
|
36 | - public function getValues() |
|
37 | - { |
|
38 | - return $this->values; |
|
39 | - } |
|
16 | + protected $properties; |
|
17 | + protected $values; |
|
18 | + |
|
19 | + function __construct($values, $properties) |
|
20 | + { |
|
21 | + $this->properties = $properties; |
|
22 | + $this->values = $values; |
|
23 | + } |
|
24 | + |
|
25 | + /** |
|
26 | + * @return mixed |
|
27 | + */ |
|
28 | + public function getProperties() |
|
29 | + { |
|
30 | + return $this->properties; |
|
31 | + } |
|
32 | + |
|
33 | + /** |
|
34 | + * @return mixed |
|
35 | + */ |
|
36 | + public function getValues() |
|
37 | + { |
|
38 | + return $this->values; |
|
39 | + } |
|
40 | 40 | |
41 | 41 | |
42 | 42 |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
26 | - * @param {string} $filename The path to the iCal-file |
|
27 | - * @return Object The iCal-Object |
|
26 | + * @param string $filename The path to the iCal-file |
|
27 | + * @return boolean The iCal-Object |
|
28 | 28 | */ |
29 | 29 | public function parseFromFile($filename) |
30 | 30 | { |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | /** |
103 | 103 | * This is only for debugging. |
104 | 104 | * This class ensures all dates returned are in UTC, whatever the input time zone was. |
105 | - * @return type |
|
105 | + * @return string |
|
106 | 106 | */ |
107 | 107 | public function getTimeZoneIdentifier() |
108 | 108 | { |
@@ -13,14 +13,14 @@ discard block |
||
13 | 13 | class ICalParser |
14 | 14 | { |
15 | 15 | |
16 | - /** @var ICalTimeZone **/ |
|
17 | - protected $timezone; |
|
16 | + /** @var ICalTimeZone **/ |
|
17 | + protected $timezone; |
|
18 | 18 | |
19 | - protected $events = array(); |
|
19 | + protected $events = array(); |
|
20 | 20 | |
21 | - public function __construct() { |
|
22 | - $this->timezone = new ICalTimeZone(); |
|
23 | - } |
|
21 | + public function __construct() { |
|
22 | + $this->timezone = new ICalTimeZone(); |
|
23 | + } |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * @param {string} $filename The path to the iCal-file |
@@ -29,90 +29,90 @@ discard block |
||
29 | 29 | public function parseFromFile($filename) |
30 | 30 | { |
31 | 31 | |
32 | - if (!$filename) { |
|
33 | - return false; |
|
34 | - } |
|
32 | + if (!$filename) { |
|
33 | + return false; |
|
34 | + } |
|
35 | 35 | |
36 | - $lines = file($filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
|
37 | - if (count($lines) < 1) { |
|
38 | - return false; |
|
39 | - } |
|
36 | + $lines = file($filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
|
37 | + if (count($lines) < 1) { |
|
38 | + return false; |
|
39 | + } |
|
40 | 40 | |
41 | 41 | if (stristr($lines[0], 'BEGIN:VCALENDAR') === false) { |
42 | 42 | return false; |
43 | 43 | } else { |
44 | 44 | |
45 | - # pass1: put multi lines back into one line. |
|
46 | - $linesCompacted = array(); |
|
47 | - foreach($lines as $line) { |
|
48 | - if (substr($line,0,1) == ' ') { |
|
49 | - $linesCompacted[count($linesCompacted)-1] .= substr($line, 1); |
|
50 | - } else { |
|
51 | - $linesCompacted[] = trim($line); |
|
52 | - } |
|
53 | - }; |
|
45 | + # pass1: put multi lines back into one line. |
|
46 | + $linesCompacted = array(); |
|
47 | + foreach($lines as $line) { |
|
48 | + if (substr($line,0,1) == ' ') { |
|
49 | + $linesCompacted[count($linesCompacted)-1] .= substr($line, 1); |
|
50 | + } else { |
|
51 | + $linesCompacted[] = trim($line); |
|
52 | + } |
|
53 | + }; |
|
54 | 54 | |
55 | - #pass2: turn lines into formatted data |
|
56 | - $rawLines = array(); |
|
57 | - foreach($linesCompacted as $line) { |
|
58 | - $bits = explode(":", $line, 2); |
|
59 | - $kbits = explode(";", $bits[0], 2); |
|
60 | - $value = count($bits) == 2 ? $bits[1] : ''; |
|
61 | - // http://www.ietf.org/rfc/rfc2445.txt section 4.3.11 |
|
62 | - $value = str_replace('\\\\', '\\', $value); |
|
63 | - $value = str_replace('\\N', "\n", $value); |
|
64 | - $value = str_replace('\\n', "\n", $value); |
|
65 | - $value = str_replace('\\;', ';', $value); |
|
66 | - $value = str_replace('\,', ',', $value); |
|
67 | - $rawLines[] = array( |
|
68 | - 'KEYWORD'=>$kbits[0], |
|
69 | - 'KEYWORDOPTIONS'=>count($kbits) == 2 ? $kbits[1] : '', |
|
70 | - 'VALUE'=>$value, |
|
71 | - ); |
|
72 | - } |
|
55 | + #pass2: turn lines into formatted data |
|
56 | + $rawLines = array(); |
|
57 | + foreach($linesCompacted as $line) { |
|
58 | + $bits = explode(":", $line, 2); |
|
59 | + $kbits = explode(";", $bits[0], 2); |
|
60 | + $value = count($bits) == 2 ? $bits[1] : ''; |
|
61 | + // http://www.ietf.org/rfc/rfc2445.txt section 4.3.11 |
|
62 | + $value = str_replace('\\\\', '\\', $value); |
|
63 | + $value = str_replace('\\N', "\n", $value); |
|
64 | + $value = str_replace('\\n', "\n", $value); |
|
65 | + $value = str_replace('\\;', ';', $value); |
|
66 | + $value = str_replace('\,', ',', $value); |
|
67 | + $rawLines[] = array( |
|
68 | + 'KEYWORD'=>$kbits[0], |
|
69 | + 'KEYWORDOPTIONS'=>count($kbits) == 2 ? $kbits[1] : '', |
|
70 | + 'VALUE'=>$value, |
|
71 | + ); |
|
72 | + } |
|
73 | 73 | |
74 | - # pass3: finally parse lines |
|
75 | - $stack = array(); |
|
76 | - foreach($rawLines as $line) { |
|
77 | - if ($line['KEYWORD'] == 'BEGIN') { |
|
78 | - $stack[] = $line['VALUE']; |
|
79 | - if ($line['VALUE'] == 'VEVENT') { |
|
80 | - $this->events[] = new ICalEvent($this->timezone->getTimeZone()); |
|
81 | - } |
|
82 | - } else if ($line['KEYWORD'] == 'END') { |
|
83 | - // TODO check VALUE and last stack match |
|
84 | - array_pop($stack); |
|
85 | - } else { |
|
86 | - $currentlyIn = $stack[count($stack)-1]; |
|
87 | - //print $currentlyIn." with K ".$line['KEYWORD']."\n"; |
|
88 | - if ($currentlyIn == 'VEVENT') { |
|
89 | - $this->events[count($this->events)-1]->processLine($line['KEYWORD'],$line['VALUE'], $line['KEYWORDOPTIONS']); |
|
90 | - } elseif ($currentlyIn == 'VTIMEZONE') { |
|
91 | - $this->timezone->processLine($line['KEYWORD'],$line['VALUE'], $line['KEYWORDOPTIONS']); |
|
92 | - } |
|
93 | - } |
|
94 | - } |
|
74 | + # pass3: finally parse lines |
|
75 | + $stack = array(); |
|
76 | + foreach($rawLines as $line) { |
|
77 | + if ($line['KEYWORD'] == 'BEGIN') { |
|
78 | + $stack[] = $line['VALUE']; |
|
79 | + if ($line['VALUE'] == 'VEVENT') { |
|
80 | + $this->events[] = new ICalEvent($this->timezone->getTimeZone()); |
|
81 | + } |
|
82 | + } else if ($line['KEYWORD'] == 'END') { |
|
83 | + // TODO check VALUE and last stack match |
|
84 | + array_pop($stack); |
|
85 | + } else { |
|
86 | + $currentlyIn = $stack[count($stack)-1]; |
|
87 | + //print $currentlyIn." with K ".$line['KEYWORD']."\n"; |
|
88 | + if ($currentlyIn == 'VEVENT') { |
|
89 | + $this->events[count($this->events)-1]->processLine($line['KEYWORD'],$line['VALUE'], $line['KEYWORDOPTIONS']); |
|
90 | + } elseif ($currentlyIn == 'VTIMEZONE') { |
|
91 | + $this->timezone->processLine($line['KEYWORD'],$line['VALUE'], $line['KEYWORDOPTIONS']); |
|
92 | + } |
|
93 | + } |
|
94 | + } |
|
95 | 95 | |
96 | - //die(); |
|
96 | + //die(); |
|
97 | 97 | |
98 | - return true; |
|
99 | - } |
|
98 | + return true; |
|
99 | + } |
|
100 | 100 | } |
101 | 101 | |
102 | - /** |
|
103 | - * This is only for debugging. |
|
104 | - * This class ensures all dates returned are in UTC, whatever the input time zone was. |
|
105 | - * @return type |
|
106 | - */ |
|
107 | - public function getTimeZoneIdentifier() |
|
108 | - { |
|
109 | - return $this->timezone->getTimeZoneIdentifier(); |
|
110 | - } |
|
102 | + /** |
|
103 | + * This is only for debugging. |
|
104 | + * This class ensures all dates returned are in UTC, whatever the input time zone was. |
|
105 | + * @return type |
|
106 | + */ |
|
107 | + public function getTimeZoneIdentifier() |
|
108 | + { |
|
109 | + return $this->timezone->getTimeZoneIdentifier(); |
|
110 | + } |
|
111 | 111 | |
112 | 112 | public function getEvents() |
113 | 113 | { |
114 | - return $this->events; |
|
115 | - } |
|
114 | + return $this->events; |
|
115 | + } |
|
116 | 116 | |
117 | 117 | } |
118 | 118 |