@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | { |
247 | 247 | static $regex; |
248 | 248 | |
249 | - if ( ! isset($regex)) { |
|
249 | + if (!isset($regex)) { |
|
250 | 250 | $regex = sprintf( |
251 | 251 | '/(%s)|%s/%s', |
252 | 252 | implode(')|(', $this->getCatchablePatterns()), |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | |
291 | 291 | foreach ($constants as $name => $value) { |
292 | 292 | if ($value === $token) { |
293 | - return $className . '::' . $name; |
|
293 | + return $className.'::'.$name; |
|
294 | 294 | } |
295 | 295 | } |
296 | 296 |
@@ -325,10 +325,10 @@ discard block |
||
325 | 325 | |
326 | 326 | if ($node instanceof ICalendarObjectContainer) { |
327 | 327 | $propFind->handle($ns.'max-resource-size', $this->maxResourceSize); |
328 | - $propFind->handle($ns.'supported-calendar-data', function () { |
|
328 | + $propFind->handle($ns.'supported-calendar-data', function() { |
|
329 | 329 | return new Xml\Property\SupportedCalendarData(); |
330 | 330 | }); |
331 | - $propFind->handle($ns.'supported-collation-set', function () { |
|
331 | + $propFind->handle($ns.'supported-collation-set', function() { |
|
332 | 332 | return new Xml\Property\SupportedCollationSet(); |
333 | 333 | }); |
334 | 334 | } |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | if ($node instanceof DAVACL\IPrincipal) { |
337 | 337 | $principalUrl = $node->getPrincipalUrl(); |
338 | 338 | |
339 | - $propFind->handle('{'.self::NS_CALDAV.'}calendar-home-set', function () use ($principalUrl) { |
|
339 | + $propFind->handle('{'.self::NS_CALDAV.'}calendar-home-set', function() use ($principalUrl) { |
|
340 | 340 | $calendarHomePath = $this->getCalendarHomeForPrincipal($principalUrl); |
341 | 341 | if (is_null($calendarHomePath)) { |
342 | 342 | return null; |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | }); |
347 | 347 | // The calendar-user-address-set property is basically mapped to |
348 | 348 | // the {DAV:}alternate-URI-set property. |
349 | - $propFind->handle('{'.self::NS_CALDAV.'}calendar-user-address-set', function () use ($node) { |
|
349 | + $propFind->handle('{'.self::NS_CALDAV.'}calendar-user-address-set', function() use ($node) { |
|
350 | 350 | $addresses = $node->getAlternateUriSet(); |
351 | 351 | $addresses[] = $this->server->getBaseUri().$node->getPrincipalUrl().'/'; |
352 | 352 | |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | }); |
355 | 355 | // For some reason somebody thought it was a good idea to add |
356 | 356 | // another one of these properties. We're supporting it too. |
357 | - $propFind->handle('{'.self::NS_CALENDARSERVER.'}email-address-set', function () use ($node) { |
|
357 | + $propFind->handle('{'.self::NS_CALENDARSERVER.'}email-address-set', function() use ($node) { |
|
358 | 358 | $addresses = $node->getAlternateUriSet(); |
359 | 359 | $emails = []; |
360 | 360 | foreach ($addresses as $address) { |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | // The calendar-data property is not supposed to be a 'real' |
403 | 403 | // property, but in large chunks of the spec it does act as such. |
404 | 404 | // Therefore we simply expose it as a property. |
405 | - $propFind->handle('{'.self::NS_CALDAV.'}calendar-data', function () use ($node) { |
|
405 | + $propFind->handle('{'.self::NS_CALDAV.'}calendar-data', function() use ($node) { |
|
406 | 406 | $val = $node->get(); |
407 | 407 | if (is_resource($val)) { |
408 | 408 | $val = stream_get_contents($val); |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | 'time-range' => null, |
685 | 685 | ]); |
686 | 686 | |
687 | - $objects = array_map(function ($url) use ($calendar) { |
|
687 | + $objects = array_map(function($url) use ($calendar) { |
|
688 | 688 | $obj = $calendar->getChild($url)->get(); |
689 | 689 | |
690 | 690 | return $obj; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | $this->server = $server; |
66 | 66 | $server->on('method:GET', [$this, 'httpGet'], 90); |
67 | - $server->on('browserButtonActions', function ($path, $node, &$actions) { |
|
67 | + $server->on('browserButtonActions', function($path, $node, &$actions) { |
|
68 | 68 | if ($node instanceof ICalendar) { |
69 | 69 | $actions .= '<a href="'.htmlspecialchars($path, ENT_QUOTES, 'UTF-8').'?export"><span class="oi" data-glyph="calendar"></span></a>'; |
70 | 70 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | // queryResult is just a list of base urls. We need to prefix the |
204 | 204 | // calendar path. |
205 | 205 | $queryResult = array_map( |
206 | - function ($item) use ($path) { |
|
206 | + function($item) use ($path) { |
|
207 | 207 | return $path.'/'.$item; |
208 | 208 | }, |
209 | 209 | $queryResult |
@@ -50,7 +50,7 @@ |
||
50 | 50 | */ |
51 | 51 | public function getMultipleCalendarObjects($calendarId, array $uris) |
52 | 52 | { |
53 | - return array_map(function ($uri) use ($calendarId) { |
|
53 | + return array_map(function($uri) use ($calendarId) { |
|
54 | 54 | return $this->getCalendarObject($calendarId, $uri); |
55 | 55 | }, $uris); |
56 | 56 | } |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | $supportedProperties = array_keys($this->propertyMap); |
301 | 301 | $supportedProperties[] = '{'.CalDAV\Plugin::NS_CALDAV.'}schedule-calendar-transp'; |
302 | 302 | |
303 | - $propPatch->handle($supportedProperties, function ($mutations) use ($calendarId, $instanceId) { |
|
303 | + $propPatch->handle($supportedProperties, function($mutations) use ($calendarId, $instanceId) { |
|
304 | 304 | $newValues = []; |
305 | 305 | foreach ($mutations as $propertyName => $propertyValue) { |
306 | 306 | switch ($propertyName) { |
@@ -1185,7 +1185,7 @@ discard block |
||
1185 | 1185 | $supportedProperties = array_keys($this->subscriptionPropertyMap); |
1186 | 1186 | $supportedProperties[] = '{http://calendarserver.org/ns/}source'; |
1187 | 1187 | |
1188 | - $propPatch->handle($supportedProperties, function ($mutations) use ($subscriptionId) { |
|
1188 | + $propPatch->handle($supportedProperties, function($mutations) use ($subscriptionId) { |
|
1189 | 1189 | $newValues = []; |
1190 | 1190 | |
1191 | 1191 | foreach ($mutations as $propertyName => $propertyValue) { |
@@ -87,7 +87,7 @@ |
||
87 | 87 | $principalUrl = $node->getPrincipalUrl(); |
88 | 88 | |
89 | 89 | // notification-URL property |
90 | - $propFind->handle('{'.self::NS_CALENDARSERVER.'}notification-URL', function () use ($principalUrl, $caldavPlugin) { |
|
90 | + $propFind->handle('{'.self::NS_CALENDARSERVER.'}notification-URL', function() use ($principalUrl, $caldavPlugin) { |
|
91 | 91 | $notificationPath = $caldavPlugin->getCalendarHomeForPrincipal($principalUrl).'/notifications/'; |
92 | 92 | |
93 | 93 | return new DAV\Xml\Property\Href($notificationPath); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | public function propFindEarly(DAV\PropFind $propFind, DAV\INode $node) |
102 | 102 | { |
103 | 103 | if ($node instanceof ISharedCalendar) { |
104 | - $propFind->handle('{'.Plugin::NS_CALENDARSERVER.'}invite', function () use ($node) { |
|
104 | + $propFind->handle('{'.Plugin::NS_CALENDARSERVER.'}invite', function() use ($node) { |
|
105 | 105 | return new Xml\Property\Invite( |
106 | 106 | $node->getInvites() |
107 | 107 | ); |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | break; |
130 | 130 | } |
131 | 131 | } |
132 | - $propFind->handle('{'.Plugin::NS_CALENDARSERVER.'}allowed-sharing-modes', function () { |
|
132 | + $propFind->handle('{'.Plugin::NS_CALENDARSERVER.'}allowed-sharing-modes', function() { |
|
133 | 133 | return new Xml\Property\AllowedSharingModes(true, false); |
134 | 134 | }); |
135 | 135 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | } |
157 | 157 | |
158 | 158 | if (\Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER === $node->getShareAccess() || \Sabre\DAV\Sharing\Plugin::ACCESS_NOTSHARED === $node->getShareAccess()) { |
159 | - $propPatch->handle('{DAV:}resourcetype', function ($value) use ($node) { |
|
159 | + $propPatch->handle('{DAV:}resourcetype', function($value) use ($node) { |
|
160 | 160 | if ($value->is('{'.Plugin::NS_CALENDARSERVER.'}shared-owner')) { |
161 | 161 | return false; |
162 | 162 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | $principalUrl = $node->getPrincipalUrl(); |
199 | 199 | |
200 | 200 | // schedule-outbox-URL property |
201 | - $propFind->handle('{'.self::NS_CALDAV.'}schedule-outbox-URL', function () use ($principalUrl, $caldavPlugin) { |
|
201 | + $propFind->handle('{'.self::NS_CALDAV.'}schedule-outbox-URL', function() use ($principalUrl, $caldavPlugin) { |
|
202 | 202 | $calendarHomePath = $caldavPlugin->getCalendarHomeForPrincipal($principalUrl); |
203 | 203 | if (!$calendarHomePath) { |
204 | 204 | return null; |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | return new LocalHref($outboxPath); |
209 | 209 | }); |
210 | 210 | // schedule-inbox-URL property |
211 | - $propFind->handle('{'.self::NS_CALDAV.'}schedule-inbox-URL', function () use ($principalUrl, $caldavPlugin) { |
|
211 | + $propFind->handle('{'.self::NS_CALDAV.'}schedule-inbox-URL', function() use ($principalUrl, $caldavPlugin) { |
|
212 | 212 | $calendarHomePath = $caldavPlugin->getCalendarHomeForPrincipal($principalUrl); |
213 | 213 | if (!$calendarHomePath) { |
214 | 214 | return null; |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | return new LocalHref($inboxPath); |
219 | 219 | }); |
220 | 220 | |
221 | - $propFind->handle('{'.self::NS_CALDAV.'}schedule-default-calendar-URL', function () use ($principalUrl, $caldavPlugin) { |
|
221 | + $propFind->handle('{'.self::NS_CALDAV.'}schedule-default-calendar-URL', function() use ($principalUrl, $caldavPlugin) { |
|
222 | 222 | // We don't support customizing this property yet, so in the |
223 | 223 | // meantime we just grab the first calendar in the home-set. |
224 | 224 | $calendarHomePath = $caldavPlugin->getCalendarHomeForPrincipal($principalUrl); |
@@ -258,13 +258,13 @@ discard block |
||
258 | 258 | |
259 | 259 | // The server currently reports every principal to be of type |
260 | 260 | // 'INDIVIDUAL' |
261 | - $propFind->handle('{'.self::NS_CALDAV.'}calendar-user-type', function () { |
|
261 | + $propFind->handle('{'.self::NS_CALDAV.'}calendar-user-type', function() { |
|
262 | 262 | return 'INDIVIDUAL'; |
263 | 263 | }); |
264 | 264 | } |
265 | 265 | |
266 | 266 | // Mapping the old property to the new property. |
267 | - $propFind->handle('{http://calendarserver.org/ns/}calendar-availability', function () use ($propFind, $node) { |
|
267 | + $propFind->handle('{http://calendarserver.org/ns/}calendar-availability', function() use ($propFind, $node) { |
|
268 | 268 | // In case it wasn't clear, the only difference is that we map the |
269 | 269 | // old property to a different namespace. |
270 | 270 | $availProp = '{'.self::NS_CALDAV.'}calendar-availability'; |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | public function propPatch($path, PropPatch $propPatch) |
295 | 295 | { |
296 | 296 | // Mapping the old property to the new property. |
297 | - $propPatch->handle('{http://calendarserver.org/ns/}calendar-availability', function ($value) use ($path) { |
|
297 | + $propPatch->handle('{http://calendarserver.org/ns/}calendar-availability', function($value) use ($path) { |
|
298 | 298 | $availProp = '{'.self::NS_CALDAV.'}calendar-availability'; |
299 | 299 | $subPropPatch = new PropPatch([$availProp => $value]); |
300 | 300 | $this->server->emit('propPatch', [$path, $subPropPatch]); |
@@ -919,7 +919,7 @@ discard block |
||
919 | 919 | 'time-range' => null, |
920 | 920 | ]); |
921 | 921 | |
922 | - $calObjects = array_map(function ($url) use ($node) { |
|
922 | + $calObjects = array_map(function($url) use ($node) { |
|
923 | 923 | $obj = $node->getChild($url)->get(); |
924 | 924 | |
925 | 925 | return $obj; |
@@ -136,22 +136,22 @@ discard block |
||
136 | 136 | |
137 | 137 | if ($node instanceof IAddressBook) { |
138 | 138 | $propFind->handle($ns.'max-resource-size', $this->maxResourceSize); |
139 | - $propFind->handle($ns.'supported-address-data', function () { |
|
139 | + $propFind->handle($ns.'supported-address-data', function() { |
|
140 | 140 | return new Xml\Property\SupportedAddressData(); |
141 | 141 | }); |
142 | - $propFind->handle($ns.'supported-collation-set', function () { |
|
142 | + $propFind->handle($ns.'supported-collation-set', function() { |
|
143 | 143 | return new Xml\Property\SupportedCollationSet(); |
144 | 144 | }); |
145 | 145 | } |
146 | 146 | if ($node instanceof DAVACL\IPrincipal) { |
147 | 147 | $path = $propFind->getPath(); |
148 | 148 | |
149 | - $propFind->handle('{'.self::NS_CARDDAV.'}addressbook-home-set', function () use ($path) { |
|
149 | + $propFind->handle('{'.self::NS_CARDDAV.'}addressbook-home-set', function() use ($path) { |
|
150 | 150 | return new LocalHref($this->getAddressBookHomeForPrincipal($path).'/'); |
151 | 151 | }); |
152 | 152 | |
153 | 153 | if ($this->directories) { |
154 | - $propFind->handle('{'.self::NS_CARDDAV.'}directory-gateway', function () { |
|
154 | + $propFind->handle('{'.self::NS_CARDDAV.'}directory-gateway', function() { |
|
155 | 155 | return new LocalHref($this->directories); |
156 | 156 | }); |
157 | 157 | } |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | // The address-data property is not supposed to be a 'real' |
162 | 162 | // property, but in large chunks of the spec it does act as such. |
163 | 163 | // Therefore we simply expose it as a property. |
164 | - $propFind->handle('{'.self::NS_CARDDAV.'}address-data', function () use ($node) { |
|
164 | + $propFind->handle('{'.self::NS_CARDDAV.'}address-data', function() use ($node) { |
|
165 | 165 | $val = $node->get(); |
166 | 166 | if (is_resource($val)) { |
167 | 167 | $val = stream_get_contents($val); |
@@ -808,7 +808,7 @@ discard block |
||
808 | 808 | $input = VObject\Reader::read($data); |
809 | 809 | if (!empty($propertiesFilter)) { |
810 | 810 | $propertiesFilter = array_merge(['UID', 'VERSION', 'FN'], $propertiesFilter); |
811 | - $keys = array_unique(array_map(function ($child) { |
|
811 | + $keys = array_unique(array_map(function($child) { |
|
812 | 812 | return $child->name; |
813 | 813 | }, $input->children())); |
814 | 814 | $keys = array_diff($keys, $propertiesFilter); |