Completed
Branch master (c3ca5f)
by Seth
04:51
created
phpicalendar/lib/HTTP/CalDAV/Server.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      *               string property name
54 54
      *               string property value
55 55
      */
56
-    function calDavProp($name, $value=null, $status=null) {
56
+    function calDavProp($name, $value = null, $status = null) {
57 57
         return $this->mkprop('urn:ietf:params:xml:ns:caldav', $name, $value,
58 58
             $status);
59 59
     }
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
             foreach ($response['ns_hash'] as $name => $prefix) {
210 210
                 $ns_defs[] = "xmlns:$prefix=\"$name\"";
211 211
             }
212
-            echo ' <D:response ' . implode(' ', $ns_defs) . ">\n";
212
+            echo ' <D:response '.implode(' ', $ns_defs).">\n";
213 213
             echo "  <D:href>$response[href]</D:href>\n";
214 214
 
215 215
             // report all found properties and their values (if any)
@@ -236,8 +236,8 @@  discard block
 block discarded – undo
236 236
                             }
237 237
 
238 238
                             if (!empty($prop['ns'])) {
239
-                                echo '    <' .
240
-                                    $response['ns_hash'][$prop['ns']] .
239
+                                echo '    <'.
240
+                                    $response['ns_hash'][$prop['ns']].
241 241
                                     ":$prop[name]/>\n";
242 242
                                 continue;
243 243
                             }
@@ -252,13 +252,13 @@  discard block
 block discarded – undo
252 252
                             switch ($prop['name']) {
253 253
                             case 'creationdate':
254 254
                                 echo "    <D:creationdate ns0:dt=\"dateTime.tz\">\n";
255
-                                echo '     ' . gmdate('Y-m-d\TH:i:s\Z', $prop['value']) . "\n";
255
+                                echo '     '.gmdate('Y-m-d\TH:i:s\Z', $prop['value'])."\n";
256 256
                                 echo "    </D:creationdate>\n";
257 257
                                 break;
258 258
 
259 259
                             case 'getlastmodified':
260 260
                                 echo "    <D:getlastmodified ns0:dt=\"dateTime.rfc1123\">\n";
261
-                                echo '     ' . gmdate('D, d M Y H:i:s', $prop['value']) . " GMT\n";
261
+                                echo '     '.gmdate('D, d M Y H:i:s', $prop['value'])." GMT\n";
262 262
                                 echo "    </D:getlastmodified>\n";
263 263
                                 break;
264 264
 
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 
291 291
                             default:
292 292
                                 echo "    <D:$prop[name]>\n";
293
-                                echo '     ' . $this->_prop_encode(htmlspecialchars($prop['value'])) . "\n";
293
+                                echo '     '.$this->_prop_encode(htmlspecialchars($prop['value']))."\n";
294 294
                                 echo "    </D:$prop[name]>\n";
295 295
                             }
296 296
 
@@ -303,15 +303,15 @@  discard block
 block discarded – undo
303 303
                         }
304 304
 
305 305
                         if (!empty($prop['ns'])) {
306
-                            echo '    <' . $response['ns_hash'][$prop['ns']] . ":$prop[name]>\n";
307
-                            echo '     ' . $this->_prop_encode(htmlspecialchars($prop['value'])) . "\n";
308
-                            echo '    </' . $response['ns_hash'][$prop['ns']] . ":$prop[name]>\n";
306
+                            echo '    <'.$response['ns_hash'][$prop['ns']].":$prop[name]>\n";
307
+                            echo '     '.$this->_prop_encode(htmlspecialchars($prop['value']))."\n";
308
+                            echo '    </'.$response['ns_hash'][$prop['ns']].":$prop[name]>\n";
309 309
 
310 310
                             continue;
311 311
                         }
312 312
 
313 313
                         echo "    <$prop[name] xmlns=\"\">\n";
314
-                        echo '     ' . $this->_prop_encode(htmlspecialchars($prop['value'])) . "\n";
314
+                        echo '     '.$this->_prop_encode(htmlspecialchars($prop['value']))."\n";
315 315
                         echo "    </$prop[name]>\n";
316 316
                     }
317 317
 
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 
328 328
             if (isset($response['responsedescription'])) {
329 329
                 echo "  <D:responsedescription>\n";
330
-                echo '   ' . $this->_prop_encode(htmlspecialchars($response['responsedescription'])) . "\n";
330
+                echo '   '.$this->_prop_encode(htmlspecialchars($response['responsedescription']))."\n";
331 331
                 echo "  </D:responsedescription>\n";
332 332
             }
333 333
 
Please login to merge, or discard this patch.
phpicalendar/lib/HTTP/CalDAV/Tools/ICalendarParser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
      * @param resource input stream handle
152 152
      * @access public
153 153
      */
154
-    function ICalendarParser($handle, $offsets=null, $value=null, $filters=null)
154
+    function ICalendarParser($handle, $offsets = null, $value = null, $filters = null)
155 155
     {
156 156
         $this->_handle = $handle;
157 157
         $this->_offsetStack[] = $offsets;
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
             return;
234 234
         }
235 235
 
236
-        $class = 'iCalendar_' . ltrim(strtolower($name), 'v');
236
+        $class = 'iCalendar_'.ltrim(strtolower($name), 'v');
237 237
         if ($name == 'VCALENDAR') {
238 238
             $class = 'iCalendar';
239 239
         }
Please login to merge, or discard this patch.
phpicalendar/lib/HTTP/CalDAV/Tools/ReportParser.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 
172 172
             if ($name == 'calendar-data') {
173 173
                 $prop['value'] = array();
174
-                $this->_comps[] =& $prop['value'];
174
+                $this->_comps[] = & $prop['value'];
175 175
             }
176 176
 
177 177
             $this->props[] = $prop;
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
             $this->_comps[count($this->_comps) - 1]['comps'][$attrs['name']] =
188 188
                 array();
189
-            $this->_comps[] =& $this->_comps[count($this->_comps) - 1]['comps']
189
+            $this->_comps[] = & $this->_comps[count($this->_comps) - 1]['comps']
190 190
                 [$attrs['name']];
191 191
             $this->_names[] = $name;
192 192
             return;
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
         }
204 204
 
205 205
         if (count($this->_names) == 1 && $name == 'filter') {
206
-            $this->_comps[] =& $this->filters;
206
+            $this->_comps[] = & $this->filters;
207 207
             $this->_names[] = $name;
208 208
             return;
209 209
         }
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
             $this->_comps[count($this->_comps) - 1]['comps'][$attrs['name']] =
217 217
                 array();
218
-            $this->_comps[] =& $this->_comps[count($this->_comps) - 1]['comps']
218
+            $this->_comps[] = & $this->_comps[count($this->_comps) - 1]['comps']
219 219
                 [$attrs['name']];
220 220
             $this->_names[] = $name;
221 221
             return;
Please login to merge, or discard this patch.
phpicalendar/lib/HTTP/WebDAV/Server.php 1 patch
Spacing   +61 added lines, -66 removed lines patch added patch discarded remove patch
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
     {
101 101
         // identify ourselves
102 102
         if (empty($this->dav_powered_by)) {
103
-            $this->dav_powered_by = 'PHP class: ' . get_class($this);
103
+            $this->dav_powered_by = 'PHP class: '.get_class($this);
104 104
         }
105
-        header('X-Dav-Powered-By: ' . $this->dav_powered_by);
105
+        header('X-Dav-Powered-By: '.$this->dav_powered_by);
106 106
 
107 107
         // set path
108 108
         if (empty($this->path)) {
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
             // but Microsoft Clients do not support Digest
132 132
             // and we don't support NTLM or Kerberos
133 133
             // so we are stuck with Basic here
134
-            header('WWW-Authenticate: Basic realm="' . ($this->http_auth_realm) . '"');
134
+            header('WWW-Authenticate: Basic realm="'.($this->http_auth_realm).'"');
135 135
 
136 136
             // Windows seems to require this being the last header sent
137 137
             // (changed according to PECL bug #3138)
@@ -141,14 +141,14 @@  discard block
 block discarded – undo
141 141
         }
142 142
 
143 143
         // check
144
-        if (! $this->_check_if_header_conditions()) {
144
+        if (!$this->_check_if_header_conditions()) {
145 145
             $this->http_status('412 Precondition Failed');
146 146
             return;
147 147
         }
148 148
 
149 149
         // detect requested method names
150 150
         $method = strtolower($_SERVER['REQUEST_METHOD']);
151
-        $wrapper = $method . '_wrapper';
151
+        $wrapper = $method.'_wrapper';
152 152
 
153 153
         // emulate HEAD using GET if no HEAD method found
154 154
         if ($wrapper == 'head_wrapper' &&
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
         }
171 171
 
172 172
         // tell client what's allowed
173
-        header('Allow: ' . implode(', ', $this->_allow()));
173
+        header('Allow: '.implode(', ', $this->_allow()));
174 174
         $this->http_status('405 Method Not Allowed');
175 175
     }
176 176
 
@@ -437,8 +437,8 @@  discard block
 block discarded – undo
437 437
         }
438 438
 
439 439
         // tell clients what we found
440
-        header('Allow: ' . implode(', ', $allow));
441
-        header('DAV: ' . implode(',', $dav));
440
+        header('Allow: '.implode(', ', $allow));
441
+        header('DAV: '.implode(',', $dav));
442 442
         header('Content-Length: 0');
443 443
 
444 444
         // Microsoft clients default to the Frontpage protocol
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
                     }
539 539
 
540 540
                     // register namespace
541
-                    $ns_hash[$prop['ns']] = 'ns' . count($ns_hash);
541
+                    $ns_hash[$prop['ns']] = 'ns'.count($ns_hash);
542 542
                 }
543 543
             } else if (is_array($file['props'])) {
544 544
 
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
                     }
573 573
 
574 574
                     // register namespace
575
-                    $ns_hash[$prop['ns']] = 'ns' . count($ns_hash);
575
+                    $ns_hash[$prop['ns']] = 'ns'.count($ns_hash);
576 576
                 }
577 577
             }
578 578
 
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
             foreach ($response['ns_hash'] as $name => $prefix) {
605 605
                 $ns_defs[] = "xmlns:$prefix=\"$name\"";
606 606
             }
607
-            echo ' <D:response ' . implode(' ', $ns_defs) . ">\n";
607
+            echo ' <D:response '.implode(' ', $ns_defs).">\n";
608 608
             echo "  <D:href>$response[href]</D:href>\n";
609 609
 
610 610
             // report all found properties and their values (if any)
@@ -631,8 +631,8 @@  discard block
 block discarded – undo
631 631
                             }
632 632
 
633 633
                             if (!empty($prop['ns'])) {
634
-                                echo '    <' .
635
-                                    $response['ns_hash'][$prop['ns']] .
634
+                                echo '    <'.
635
+                                    $response['ns_hash'][$prop['ns']].
636 636
                                     ":$prop[name]/>\n";
637 637
                                 continue;
638 638
                             }
@@ -647,13 +647,13 @@  discard block
 block discarded – undo
647 647
                             switch ($prop['name']) {
648 648
                             case 'creationdate':
649 649
                                 echo "    <D:creationdate ns0:dt=\"dateTime.tz\">\n";
650
-                                echo '     ' . gmdate('Y-m-d\TH:i:s\Z', $prop['value']) . "\n";
650
+                                echo '     '.gmdate('Y-m-d\TH:i:s\Z', $prop['value'])."\n";
651 651
                                 echo "    </D:creationdate>\n";
652 652
                                 break;
653 653
 
654 654
                             case 'getlastmodified':
655 655
                                 echo "    <D:getlastmodified ns0:dt=\"dateTime.rfc1123\">\n";
656
-                                echo '     ' . gmdate('D, d M Y H:i:s', $prop['value']) . " GMT\n";
656
+                                echo '     '.gmdate('D, d M Y H:i:s', $prop['value'])." GMT\n";
657 657
                                 echo "    </D:getlastmodified>\n";
658 658
                                 break;
659 659
 
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
 
686 686
                             default:
687 687
                                 echo "    <D:$prop[name]>\n";
688
-                                echo '     ' . $this->_prop_encode(htmlspecialchars($prop['value'])) . "\n";
688
+                                echo '     '.$this->_prop_encode(htmlspecialchars($prop['value']))."\n";
689 689
                                 echo "    </D:$prop[name]>\n";
690 690
                             }
691 691
 
@@ -693,15 +693,15 @@  discard block
 block discarded – undo
693 693
                         }
694 694
 
695 695
                         if (!empty($prop['ns'])) {
696
-                            echo '    <' . $response['ns_hash'][$prop['ns']] . ":$prop[name]>\n";
697
-                            echo '     ' . $this->_prop_encode(htmlspecialchars($prop['value'])) . "\n";
698
-                            echo '    </' . $response['ns_hash'][$prop['ns']] . ":$prop[name]>\n";
696
+                            echo '    <'.$response['ns_hash'][$prop['ns']].":$prop[name]>\n";
697
+                            echo '     '.$this->_prop_encode(htmlspecialchars($prop['value']))."\n";
698
+                            echo '    </'.$response['ns_hash'][$prop['ns']].":$prop[name]>\n";
699 699
 
700 700
                             continue;
701 701
                         }
702 702
 
703 703
                         echo "    <$prop[name] xmlns=\"\">\n";
704
-                        echo '     ' . $this->_prop_encode(htmlspecialchars($prop['value'])) . "\n";
704
+                        echo '     '.$this->_prop_encode(htmlspecialchars($prop['value']))."\n";
705 705
                         echo "    </$prop[name]>\n";
706 706
                     }
707 707
 
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 
718 718
             if (isset($response['responsedescription'])) {
719 719
                 echo "  <D:responsedescription>\n";
720
-                echo '   ' . $this->_prop_encode(htmlspecialchars($response['responsedescription'])) . "\n";
720
+                echo '   '.$this->_prop_encode(htmlspecialchars($response['responsedescription']))."\n";
721 721
                 echo "  </D:responsedescription>\n";
722 722
             }
723 723
 
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
      * @param responsedescr
792 792
      * @return void
793 793
      */
794
-    function proppatch_response_helper($options, $responsedescription=null)
794
+    function proppatch_response_helper($options, $responsedescription = null)
795 795
     {
796 796
         $response = array();
797 797
 
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
                 }
827 827
 
828 828
                 // register namespace
829
-                $ns_hash[$prop['ns']] = 'ns' . count($ns_hash);
829
+                $ns_hash[$prop['ns']] = 'ns'.count($ns_hash);
830 830
             }
831 831
         }
832 832
 
@@ -965,8 +965,8 @@  discard block
 block discarded – undo
965 965
         header("Content-Type: $options[mimetype]");
966 966
 
967 967
         if (isset($options['mtime'])) {
968
-            header('Last-Modified:' .
969
-                gmdate('D, d M Y H:i:s', $options['mtime']) . 'GMT');
968
+            header('Last-Modified:'.
969
+                gmdate('D, d M Y H:i:s', $options['mtime']).'GMT');
970 970
         }
971 971
 
972 972
         if ($options['stream']) {
@@ -990,7 +990,7 @@  discard block
 block discarded – undo
990 990
                             $size = $range['end'] - $range['start'] + 1;
991 991
                             $this->http_status('206 Partial');
992 992
                             header("Content-Length: $size");
993
-                            header("Content-Range: $range[start]-$range[end]/" .
993
+                            header("Content-Range: $range[start]-$range[end]/".
994 994
                                 (isset($options['size']) ? $options['size'] : '*'));
995 995
                             while ($size && !feof($options['stream'])) {
996 996
                                 $buffer = fread($options['stream'], 4096);
@@ -1000,9 +1000,9 @@  discard block
 block discarded – undo
1000 1000
                         } else {
1001 1001
                             $this->http_status('206 Partial');
1002 1002
                             if (isset($options['size'])) {
1003
-                                header("Content-Length: " .
1003
+                                header("Content-Length: ".
1004 1004
                                     ($options['size'] - $range['start']));
1005
-                                header("Content-Range: $start-$end/" .
1005
+                                header("Content-Range: $start-$end/".
1006 1006
                                     (isset($options['size']) ? $options['size'] : '*'));
1007 1007
                             }
1008 1008
                             fpassthru($options['stream']);
@@ -1046,11 +1046,11 @@  discard block
 block discarded – undo
1046 1046
 
1047 1047
                 fpassthru($options['stream']);
1048 1048
             }
1049
-        } else if (isset($options['data']))  {
1049
+        } else if (isset($options['data'])) {
1050 1050
             if (is_array($options['data'])) {
1051 1051
                 // reply to partial request
1052 1052
             } else {
1053
-                header("Content-Length: " . strlen($options['data']));
1053
+                header("Content-Length: ".strlen($options['data']));
1054 1054
                 echo $options['data'];
1055 1055
             }
1056 1056
         }
@@ -1077,10 +1077,10 @@  discard block
 block discarded – undo
1077 1077
                 // init
1078 1078
                 // a little naive, this sequence *might* be part of the content
1079 1079
                 // but it's really not likely and rather expensive to check
1080
-                $this->multipart_separator = 'SEPARATOR_' . md5(microtime());
1080
+                $this->multipart_separator = 'SEPARATOR_'.md5(microtime());
1081 1081
 
1082 1082
                 // generate HTTP header
1083
-                header('Content-Type: multipart/byteranges; boundary=' .
1083
+                header('Content-Type: multipart/byteranges; boundary='.
1084 1084
                     $this->multipart_separator);
1085 1085
 
1086 1086
                 return;
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
         echo "\n--{$this->multipart_separator}\n";
1098 1098
         echo "Content-Type: $mimetype\n";
1099 1099
         echo "Content-Range: $from-$to/"
1100
-            . ($total === false ? "*" : $total) . "\n\n";
1100
+            . ($total === false ? "*" : $total)."\n\n";
1101 1101
     }
1102 1102
 
1103 1103
     // }}}
@@ -1154,8 +1154,8 @@  discard block
 block discarded – undo
1154 1154
         header("Content-Type: $options[mimetype]");
1155 1155
 
1156 1156
         if (isset($options['mtime'])) {
1157
-            header('Last-Modified:' .
1158
-                gmdate('D, d M Y H:i:s', $options['mtime']) . 'GMT');
1157
+            header('Last-Modified:'.
1158
+                gmdate('D, d M Y H:i:s', $options['mtime']).'GMT');
1159 1159
         }
1160 1160
 
1161 1161
         if (isset($options['stream'])) {
@@ -1179,14 +1179,14 @@  discard block
 block discarded – undo
1179 1179
                             $size = $range['end'] - $range['start'] + 1;
1180 1180
                             $this->http_status('206 Partial');
1181 1181
                             header("Content-Length: $size");
1182
-                            header("Content-Range: $range[start]-$range[end]/" .
1182
+                            header("Content-Range: $range[start]-$range[end]/".
1183 1183
                                 (isset($options['size']) ? $options['size'] : '*'));
1184 1184
                         } else {
1185 1185
                             $this->http_status('206 Partial');
1186 1186
                             if (isset($options['size'])) {
1187
-                                header("Content-Length: " .
1187
+                                header("Content-Length: ".
1188 1188
                                     ($options['size'] - $range['start']));
1189
-                                header("Content-Range: $start-$end/" .
1189
+                                header("Content-Range: $start-$end/".
1190 1190
                                     (isset($options['size']) ? $options['size'] : '*'));
1191 1191
                             }
1192 1192
                         }
@@ -1201,14 +1201,12 @@  discard block
 block discarded – undo
1201 1201
                         // TODO what if size unknown? 500?
1202 1202
                         if (isset($range['start'])) {
1203 1203
                             $from = $range['start'];
1204
-                            $to = !empty($range['end']) ? $range['end'] :
1205
-                                $options['size'] - 1;
1204
+                            $to = !empty($range['end']) ? $range['end'] : $options['size'] - 1;
1206 1205
                         } else {
1207 1206
                             $from = $options['size'] - $range['last'] - 1;
1208 1207
                             $to = $options['size'] - 1;
1209 1208
                         }
1210
-                        $total = isset($options['size']) ? $options['size'] :
1211
-                            '*';
1209
+                        $total = isset($options['size']) ? $options['size'] : '*';
1212 1210
                         $size = $to - $from + 1;
1213 1211
                         $this->_multipart_byterange_header($options['mimetype'],
1214 1212
                             $from, $to, $total);
@@ -1223,11 +1221,11 @@  discard block
 block discarded – undo
1223 1221
                     header("Content-Length: $options[size]");
1224 1222
                 }
1225 1223
             }
1226
-        } else if (isset($options['data']))  {
1224
+        } else if (isset($options['data'])) {
1227 1225
             if (is_array($options['data'])) {
1228 1226
                 // reply to partial request
1229 1227
             } else {
1230
-                header("Content-Length: " . strlen($options['data']));
1228
+                header("Content-Length: ".strlen($options['data']));
1231 1229
             }
1232 1230
         }
1233 1231
     }
@@ -1384,8 +1382,7 @@  discard block
 block discarded – undo
1384 1382
         } else if (is_resource($status) &&
1385 1383
                 get_resource_type($status) == 'stream') {
1386 1384
             $stream = $status;
1387
-            $status = $options['new'] === false ? '204 No Content' :
1388
-                '201 Created';
1385
+            $status = $options['new'] === false ? '204 No Content' : '201 Created';
1389 1386
 
1390 1387
             if (!empty($options['ranges'])) {
1391 1388
 
@@ -1576,8 +1573,7 @@  discard block
 block discarded – undo
1576 1573
         // call user handler
1577 1574
         $status = $this->copy($options);
1578 1575
         if ($status === true) {
1579
-            $status = $options['new'] === false ? '204 No Content' :
1580
-                '201 Created';
1576
+            $status = $options['new'] === false ? '204 No Content' : '201 Created';
1581 1577
         }
1582 1578
 
1583 1579
         $this->http_status($status);
@@ -1616,8 +1612,7 @@  discard block
 block discarded – undo
1616 1612
         // call user handler
1617 1613
         $status = $this->move($options);
1618 1614
         if ($status === true) {
1619
-            $status = $options['new'] === false ? '204 No Content' :
1620
-                '201 Created';
1615
+            $status = $options['new'] === false ? '204 No Content' : '201 Created';
1621 1616
         }
1622 1617
 
1623 1618
         $this->http_status($status);
@@ -1720,7 +1715,7 @@  discard block
 block discarded – undo
1720 1715
             echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
1721 1716
             echo "<D:prop xmlns:D=\"DAV:\">\n";
1722 1717
             echo " <D:lockdiscovery>\n";
1723
-            echo '  ' . $this->_activelocks(array($options)) . "\n";
1718
+            echo '  '.$this->_activelocks(array($options))."\n";
1724 1719
             echo " </D:lockdiscovery>\n";
1725 1720
             echo "</D:prop>\n";
1726 1721
         }
@@ -1816,7 +1811,7 @@  discard block
 block discarded – undo
1816 1811
 
1817 1812
     function getHref($path)
1818 1813
     {
1819
-        return $this->base_uri . '/' . $path;
1814
+        return $this->base_uri.'/'.$path;
1820 1815
     }
1821 1816
 
1822 1817
     function getProp($reqprop, $file, $options)
@@ -1875,7 +1870,7 @@  discard block
 block discarded – undo
1875 1870
         // all other methods need both a method_wrapper() and a method()
1876 1871
         // implementation
1877 1872
         // the base class defines only wrappers
1878
-        foreach(get_class_methods($this) as $method) {
1873
+        foreach (get_class_methods($this) as $method) {
1879 1874
 
1880 1875
             // strncmp breaks with negative len -
1881 1876
             // http://bugs.php.net/bug.php?id=36944
@@ -1977,7 +1972,7 @@  discard block
 block discarded – undo
1977 1972
         }
1978 1973
 
1979 1974
         // fallback
1980
-        $uuid = md5(microtime() . getmypid()); // this should be random enough for now
1975
+        $uuid = md5(microtime().getmypid()); // this should be random enough for now
1981 1976
 
1982 1977
         // set variant and version fields for 'true' random uuid
1983 1978
         $uuid{12} = '4';
@@ -1986,10 +1981,10 @@  discard block
 block discarded – undo
1986 1981
         $uuid{16} = $hex{$n};
1987 1982
 
1988 1983
         // return formated uuid
1989
-        return substr($uuid,  0, 8) . '-' .
1990
-            substr($uuid,  8, 4) . '-' .
1991
-            substr($uuid, 12, 4) . '-' .
1992
-            substr($uuid, 16, 4) . '-' .
1984
+        return substr($uuid, 0, 8).'-'.
1985
+            substr($uuid, 8, 4).'-'.
1986
+            substr($uuid, 12, 4).'-'.
1987
+            substr($uuid, 16, 4).'-'.
1993 1988
             substr($uuid, 20);
1994 1989
     }
1995 1990
 
@@ -2001,7 +1996,7 @@  discard block
 block discarded – undo
2001 1996
      */
2002 1997
     function _new_locktoken()
2003 1998
     {
2004
-        return 'opaquelocktoken:' . $this->_new_uuid();
1999
+        return 'opaquelocktoken:'.$this->_new_uuid();
2005 2000
     }
2006 2001
 
2007 2002
     // }}}
@@ -2123,15 +2118,15 @@  discard block
 block discarded – undo
2123 2118
                         break;
2124 2119
 
2125 2120
                     case 'URI':
2126
-                        $list[] = $not . "<$token[1]>";
2121
+                        $list[] = $not."<$token[1]>";
2127 2122
                         break;
2128 2123
 
2129 2124
                     case 'ETAG_WEAK':
2130
-                        $list[] = $not . "[W/'$token[1]']>";
2125
+                        $list[] = $not."[W/'$token[1]']>";
2131 2126
                         break;
2132 2127
 
2133 2128
                     case 'ETAG_STRONG':
2134
-                        $list[] = $not . "['$token[1]']>";
2129
+                        $list[] = $not."['$token[1]']>";
2135 2130
                         break;
2136 2131
 
2137 2132
                     default:
@@ -2168,9 +2163,9 @@  discard block
 block discarded – undo
2168 2163
             $this->_if_header_parser($_SERVER['HTTP_IF']);
2169 2164
 
2170 2165
         // any match is ok
2171
-        foreach($this->_if_header_uris as $uri => $conditions) {
2166
+        foreach ($this->_if_header_uris as $uri => $conditions) {
2172 2167
             if (empty($uri)) {
2173
-                $uri = $this->base_uri . '/' . $this->path;
2168
+                $uri = $this->base_uri.'/'.$this->path;
2174 2169
             }
2175 2170
 
2176 2171
             // all must match
@@ -2280,14 +2275,14 @@  discard block
 block discarded – undo
2280 2275
             // check for 'timeout' or 'expires'
2281 2276
             $timeout = 'Infinite';
2282 2277
             if (!empty($lock['expires'])) {
2283
-                $timeout = 'Second-' . ($lock['expires'] - time());
2278
+                $timeout = 'Second-'.($lock['expires'] - time());
2284 2279
             } else if (!empty($lock['timeout'])) {
2285 2280
 
2286 2281
                 // more than a million is considered an absolute timestamp
2287 2282
                 // less is more likely a relative value
2288 2283
                 $timeout = "Second-$lock[timeout]";
2289 2284
                 if ($lock['timeout'] > 1000000) {
2290
-                    $timeout = 'Second-' . ($lock['timeout'] - time());
2285
+                    $timeout = 'Second-'.($lock['timeout'] - time());
2291 2286
                 }
2292 2287
             }
2293 2288
 
Please login to merge, or discard this patch.
phpicalendar/lib/HTTP/WebDAV/Tools/_parse_proppatch.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         xml_parser_set_option($xml_parser,
102 102
                               XML_OPTION_CASE_FOLDING, false);
103 103
 
104
-        while($this->success && !feof($f_in)) {
104
+        while ($this->success && !feof($f_in)) {
105 105
             $line = fgets($f_in);
106 106
             if (is_string($line)) {
107 107
                 $had_input = true;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
             }
110 110
         } 
111 111
         
112
-        if($had_input) {
112
+        if ($had_input) {
113 113
             $this->success &= xml_parse($xml_parser, "", true);
114 114
         }
115 115
 
@@ -146,14 +146,14 @@  discard block
 block discarded – undo
146 146
             $prop = array("name" => $tag);
147 147
             $this->current = array("name" => $tag, "ns" => $ns, "status"=> 200);
148 148
             if ($this->mode == "set") {
149
-                $this->current["val"] = "";     // default set val
149
+                $this->current["val"] = ""; // default set val
150 150
             }
151 151
         }
152 152
 
153 153
         if ($this->depth >= 4) {
154 154
             $this->current["val"] .= "<$tag";
155 155
             foreach ($attr as $key => $val) {
156
-                $this->current["val"] .= ' '.$key.'="'.str_replace('"','&quot;', $val).'"';
156
+                $this->current["val"] .= ' '.$key.'="'.str_replace('"', '&quot;', $val).'"';
157 157
             }
158 158
             $this->current["val"] .= ">";
159 159
         }
Please login to merge, or discard this patch.
phpicalendar/lib/HTTP/WebDAV/Tools/_parse_lockinfo.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 							  XML_OPTION_CASE_FOLDING, false);
106 106
 
107 107
 		// parse input
108
-		while($this->success && !feof($f_in)) {
108
+		while ($this->success && !feof($f_in)) {
109 109
 			$line = fgets($f_in);
110 110
 			if (is_string($line)) {
111 111
 				$had_input = true;
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 		} 
115 115
 
116 116
 		// finish parsing
117
-		if($had_input) {
117
+		if ($had_input) {
118 118
 			$this->success &= xml_parse($xml_parser, "", true);
119 119
 		}
120 120
 
Please login to merge, or discard this patch.
phpicalendar/lib/bennu/bennu.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 class Bennu {
17 17
     function timestamp_to_datetime($t = NULL) {
18
-        if($t === NULL) {
18
+        if ($t === NULL) {
19 19
             $t = time();
20 20
         }
21 21
         return gmstrftime('%Y%m%dT%H%M%SZ', $t);
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     
31 31
         // Need another 14 random octects
32 32
         $pool = '';
33
-        for($i = 0; $i < 7; ++$i) {
33
+        for ($i = 0; $i < 7; ++$i) {
34 34
             $pool .= sprintf('%04x', mt_rand(0, 65535));
35 35
         }
36 36
     
Please login to merge, or discard this patch.
phpicalendar/lib/bennu/iCalendar_components.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
 
27 27
     function construct() {
28 28
         // Initialize the components array
29
-        if(empty($this->components)) {
29
+        if (empty($this->components)) {
30 30
             $this->components = array();
31
-            foreach($this->valid_components as $name) {
31
+            foreach ($this->valid_components as $name) {
32 32
                 $this->components[$name] = array();
33 33
             }
34 34
         }
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 
46 46
         // Are we trying to add a valid property?
47 47
         $xname = false;
48
-        if(!isset($this->valid_properties[$name])) {
48
+        if (!isset($this->valid_properties[$name])) {
49 49
             // If not, is it an x-name as per RFC 2445?
50
-            if(!rfc2445_is_xname($name)) {
50
+            if (!rfc2445_is_xname($name)) {
51 51
                 return false;
52 52
             }
53 53
             // Since this is an xname, all components are supposed to allow this property
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         }
56 56
 
57 57
         // Create a property object of the correct class
58
-        if($xname) {
58
+        if ($xname) {
59 59
             $property = new iCalendar_property_x;
60 60
             $property->set_name($name);
61 61
         }
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
         }
66 66
 
67 67
         // If $value is NULL, then this property must define a default value.
68
-        if($value === NULL) {
68
+        if ($value === NULL) {
69 69
             $value = $property->default_value();
70
-            if($value === NULL) {
70
+            if ($value === NULL) {
71 71
                 return false;
72 72
             }
73 73
         }
@@ -80,27 +80,27 @@  discard block
 block discarded – undo
80 80
         // accept a VALUE parameter, and thus change their default value type.
81 81
 
82 82
         // The parameters must be valid according to property specifications
83
-        if(!empty($parameters)) {
84
-            foreach($parameters as $paramname => $paramvalue) {
85
-                if(!$property->set_parameter($paramname, $paramvalue)) {
83
+        if (!empty($parameters)) {
84
+            foreach ($parameters as $paramname => $paramvalue) {
85
+                if (!$property->set_parameter($paramname, $paramvalue)) {
86 86
                     return false;
87 87
                 }
88 88
             }
89 89
 
90 90
             // Some parameters interact among themselves (e.g. ENCODING and VALUE)
91 91
             // so make sure that after the dust settles, these invariants hold true
92
-            if(!$property->invariant_holds()) {
92
+            if (!$property->invariant_holds()) {
93 93
                 return false;
94 94
             }
95 95
         }
96 96
 
97 97
         // $value MUST be valid according to the property data type
98
-        if(!$property->set_value($value)) {
98
+        if (!$property->set_value($value)) {
99 99
             return false;
100 100
         }
101 101
 
102 102
         // If this property is restricted to only once, blindly overwrite value
103
-        if(!$xname && $this->valid_properties[$name] & RFC2445_ONCE) {
103
+        if (!$xname && $this->valid_properties[$name] & RFC2445_ONCE) {
104 104
             $this->properties[$name] = array($property);
105 105
         }
106 106
 
@@ -110,10 +110,10 @@  discard block
 block discarded – undo
110 110
         }
111 111
 
112 112
         // Finally: after all these, does the component invariant hold?
113
-        if(!$this->invariant_holds()) {
113
+        if (!$this->invariant_holds()) {
114 114
             // If not, completely undo the property addition
115 115
             array_pop($this->properties[$name]);
116
-            if(empty($this->properties[$name])) {
116
+            if (empty($this->properties[$name])) {
117 117
                 unset($this->properties[$name]);
118 118
             }
119 119
             return false;
@@ -126,14 +126,14 @@  discard block
 block discarded – undo
126 126
     function add_component($component) {
127 127
 
128 128
         // With the detailed interface, you can add only components with this function
129
-        if(!is_object($component) || !is_subclass_of($component, 'iCalendar_component')) {
129
+        if (!is_object($component) || !is_subclass_of($component, 'iCalendar_component')) {
130 130
             return false;
131 131
         }
132 132
 
133 133
         $name = $component->get_name();
134 134
 
135 135
         // Only valid components as specified by this component are allowed
136
-        if(!in_array($name, $this->valid_components)) {
136
+        if (!in_array($name, $this->valid_components)) {
137 137
             return false;
138 138
         }
139 139
 
@@ -152,10 +152,10 @@  discard block
 block discarded – undo
152 152
 
153 153
     function is_valid() {
154 154
         // If we have any child components, check that they are all valid
155
-        if(!empty($this->components)) {
156
-            foreach($this->components as $component => $instances) {
157
-                foreach($instances as $number => $instance) {
158
-                    if(!$instance->is_valid()) {
155
+        if (!empty($this->components)) {
156
+            foreach ($this->components as $component => $instances) {
157
+                foreach ($instances as $number => $instance) {
158
+                    if (!$instance->is_valid()) {
159 159
                         return false;
160 160
                     }
161 161
                 }
@@ -164,11 +164,11 @@  discard block
 block discarded – undo
164 164
 
165 165
         // Finally, check the valid property list for any mandatory properties
166 166
         // that have not been set and do not have a default value
167
-        foreach($this->valid_properties as $property => $propdata) {
168
-            if(($propdata & RFC2445_REQUIRED) && empty($this->properties[$property])) {
167
+        foreach ($this->valid_properties as $property => $propdata) {
168
+            if (($propdata & RFC2445_REQUIRED) && empty($this->properties[$property])) {
169 169
                 $classname = 'iCalendar_property_'.strtolower(str_replace('-', '_', $property));
170 170
                 $object    = new $classname;
171
-                if($object->default_value() === NULL) {
171
+                if ($object->default_value() === NULL) {
172 172
                     return false;
173 173
                 }
174 174
                 unset($object);
@@ -180,28 +180,28 @@  discard block
 block discarded – undo
180 180
     
181 181
     function serialize() {
182 182
         // Start tag
183
-        $string = rfc2445_fold('BEGIN:'.$this->name) . RFC2445_CRLF;
183
+        $string = rfc2445_fold('BEGIN:'.$this->name).RFC2445_CRLF;
184 184
 
185 185
         // List of properties
186
-        if(!empty($this->properties)) {
187
-            foreach($this->properties as $name => $properties) {
188
-                foreach($properties as $property) {
186
+        if (!empty($this->properties)) {
187
+            foreach ($this->properties as $name => $properties) {
188
+                foreach ($properties as $property) {
189 189
                     $string .= $property->serialize();
190 190
                 }
191 191
             }
192 192
         }
193 193
 
194 194
         // List of components
195
-        if(!empty($this->components)) {
196
-            foreach($this->components as $name => $components) {
197
-                foreach($components as $component) {
195
+        if (!empty($this->components)) {
196
+            foreach ($this->components as $name => $components) {
197
+                foreach ($components as $component) {
198 198
                     $string .= $component->serialize();
199 199
                 }
200 200
             }
201 201
         }
202 202
 
203 203
         // End tag
204
-        $string .= rfc2445_fold('END:'.$this->name) . RFC2445_CRLF;
204
+        $string .= rfc2445_fold('END:'.$this->name).RFC2445_CRLF;
205 205
 
206 206
         return $string;
207 207
     }
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 
231 231
 class iCalendar_event extends iCalendar_component {
232 232
 
233
-    var $name       = 'VEVENT';
233
+    var $name = 'VEVENT';
234 234
     var $properties;
235 235
     
236 236
     function construct() {
@@ -283,21 +283,21 @@  discard block
 block discarded – undo
283 283
 
284 284
     function invariant_holds() {
285 285
         // DTEND and DURATION must not appear together
286
-        if(isset($this->properties['DTEND']) && isset($this->properties['DURATION'])) {
286
+        if (isset($this->properties['DTEND']) && isset($this->properties['DURATION'])) {
287 287
             return false;
288 288
         }
289 289
 
290 290
         
291
-        if(isset($this->properties['DTEND']) && isset($this->properties['DTSTART'])) {
291
+        if (isset($this->properties['DTEND']) && isset($this->properties['DTSTART'])) {
292 292
             // DTEND must be later than DTSTART
293 293
             // The standard is not clear on how to hande different value types though
294 294
             // TODO: handle this correctly even if the value types are different
295
-            if($this->properties['DTEND'][0]->value <= $this->properties['DTSTART'][0]->value) {
295
+            if ($this->properties['DTEND'][0]->value <= $this->properties['DTSTART'][0]->value) {
296 296
                 return false;
297 297
             }
298 298
 
299 299
             // DTEND and DTSTART must have the same value type
300
-            if($this->properties['DTEND'][0]->val_type != $this->properties['DTSTART'][0]->val_type) {
300
+            if ($this->properties['DTEND'][0]->val_type != $this->properties['DTSTART'][0]->val_type) {
301 301
                 return false;
302 302
             }
303 303
 
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 }
308 308
 
309 309
 class iCalendar_todo extends iCalendar_component {
310
-    var $name       = 'VTODO';
310
+    var $name = 'VTODO';
311 311
     var $properties;
312 312
 
313 313
     function construct() {
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 }
369 369
 
370 370
 class iCalendar_timezone extends iCalendar_component {
371
-    var $name       = 'VTIMEZONE';
371
+    var $name = 'VTIMEZONE';
372 372
     var $properties;
373 373
 
374 374
     function construct() {
Please login to merge, or discard this patch.
phpicalendar/lib/bennu/iCalendar_parameters.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 class iCalendar_parameter {
17 17
     function multiple_values_allowed($parameter) {
18
-        switch($parameter) {
18
+        switch ($parameter) {
19 19
             case 'DELEGATED-FROM':
20 20
             case 'DELEGATED-TO':
21 21
             case 'MEMBER':
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     }
27 27
 
28 28
     function default_value($parameter) {
29
-        switch($parameter) {
29
+        switch ($parameter) {
30 30
             case 'CUTYPE':   return 'INDIVIDUAL';
31 31
             case 'FBTYPE':   return 'BUSY';
32 32
             case 'PARTSTAT': return 'NEEDS-ACTION';
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     }
40 40
 
41 41
     function is_valid_value(&$parent_property, $parameter, $value) {
42
-        switch($parameter) {
42
+        switch ($parameter) {
43 43
             // These must all be a URI
44 44
             case 'ALTREP':
45 45
             case 'DIR':
@@ -104,14 +104,14 @@  discard block
 block discarded – undo
104 104
                         'VIDEO'       => array('MPEG', 'QUICKTIME', 'VND.VIVO', 'VND.MOTOROLA.VIDEO', 'VND.MOTOROLA.VIDEOP')
105 105
                 );
106 106
                 $value = strtoupper($value);
107
-                if(rfc2445_is_xname($value)) {
107
+                if (rfc2445_is_xname($value)) {
108 108
                     return true;
109 109
                 }
110 110
                 @list($type, $subtype) = explode('/', $value);
111
-                if(empty($type) || empty($subtype)) {
111
+                if (empty($type) || empty($subtype)) {
112 112
                     return false;
113 113
                 }
114
-                if(!isset($fmttypes[$type]) || !in_array($subtype, $fmttypes[$type])) {
114
+                if (!isset($fmttypes[$type]) || !in_array($subtype, $fmttypes[$type])) {
115 115
                     return false;
116 116
                 }
117 117
                 return true;
@@ -120,11 +120,11 @@  discard block
 block discarded – undo
120 120
             case 'LANGUAGE':
121 121
                 $value = strtoupper($value);
122 122
                 $parts = explode('-', $value);
123
-                foreach($parts as $part) {
124
-                    if(empty($part)) {
123
+                foreach ($parts as $part) {
124
+                    if (empty($part)) {
125 125
                         return false;
126 126
                     }
127
-                    if(strspn($part, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789') != strlen($part)) {
127
+                    if (strspn($part, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789') != strlen($part)) {
128 128
                         return false;
129 129
                     }
130 130
                 }
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
             case 'PARTSTAT':
135 135
                 $value = strtoupper($value);
136
-                switch($parent_property->parent_component) {
136
+                switch ($parent_property->parent_component) {
137 137
                     case 'VEVENT':
138 138
                         return ($value == 'NEEDS-ACTION' || $value == 'ACCEPTED' || $value == 'DECLINED' || $value == 'TENTATIVE'
139 139
                                 || $value == 'DELEGATED' || rfc2445_is_xname($value));
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
             break;
176 176
 
177 177
             case 'TZID':
178
-                if(empty($value)) {
178
+                if (empty($value)) {
179 179
                     return false;
180 180
                 }
181 181
                 return (strcspn($value, '";:,') == strlen($value));
@@ -183,16 +183,16 @@  discard block
 block discarded – undo
183 183
 
184 184
             case 'VALUE':
185 185
                 $value = strtoupper($value);
186
-                return ($value == 'BINARY'    || $value == 'BOOLEAN'    || $value == 'CAL-ADDRESS' || $value == 'DATE'    ||
187
-                        $value == 'DATE-TIME' || $value == 'DURATION'   || $value == 'FLOAT'       || $value == 'INTEGER' ||
188
-                        $value == 'PERIOD'    || $value == 'RECUR'      || $value == 'TEXT'        || $value == 'TIME'    ||
189
-                        $value == 'URI'       || $value == 'UTC-OFFSET' || rfc2445_is_xname($value));
186
+                return ($value == 'BINARY' || $value == 'BOOLEAN' || $value == 'CAL-ADDRESS' || $value == 'DATE' ||
187
+                        $value == 'DATE-TIME' || $value == 'DURATION' || $value == 'FLOAT' || $value == 'INTEGER' ||
188
+                        $value == 'PERIOD' || $value == 'RECUR' || $value == 'TEXT' || $value == 'TIME' ||
189
+                        $value == 'URI' || $value == 'UTC-OFFSET' || rfc2445_is_xname($value));
190 190
             break;
191 191
         }
192 192
     }
193 193
 
194 194
     function do_value_formatting($parameter, $value) {
195
-        switch($parameter) {
195
+        switch ($parameter) {
196 196
             // Parameters of type CAL-ADDRESS or URI MUST be double-quoted
197 197
             case 'ALTREP':
198 198
             case 'DIR':
Please login to merge, or discard this patch.