@@ -101,7 +101,7 @@ |
||
101 | 101 | '{'.CardDAV\Plugin::NS_CARDDAV.'}addressbook-description', |
102 | 102 | ]; |
103 | 103 | |
104 | - $propPatch->handle($supportedProperties, function ($mutations) use ($addressBookId) { |
|
104 | + $propPatch->handle($supportedProperties, function($mutations) use ($addressBookId) { |
|
105 | 105 | $updates = []; |
106 | 106 | foreach ($mutations as $property => $newValue) { |
107 | 107 | switch ($property) { |
@@ -37,7 +37,7 @@ |
||
37 | 37 | { |
38 | 38 | $this->server = $server; |
39 | 39 | $this->server->on('method:GET', [$this, 'httpGet'], 90); |
40 | - $server->on('browserButtonActions', function ($path, $node, &$actions) { |
|
40 | + $server->on('browserButtonActions', function($path, $node, &$actions) { |
|
41 | 41 | if ($node instanceof IAddressBook) { |
42 | 42 | $actions .= '<a href="'.htmlspecialchars($path, ENT_QUOTES, 'UTF-8').'?export"><span class="oi" data-glyph="book"></span></a>'; |
43 | 43 | } |
@@ -53,11 +53,11 @@ |
||
53 | 53 | ]; |
54 | 54 | |
55 | 55 | $elems = (array) $reader->parseInnerTree(); |
56 | - $elems = array_filter($elems, function ($element) { |
|
56 | + $elems = array_filter($elems, function($element) { |
|
57 | 57 | return '{urn:ietf:params:xml:ns:carddav}prop' === $element['name'] && |
58 | 58 | isset($element['attributes']['name']); |
59 | 59 | }); |
60 | - $result['addressDataProperties'] = array_map(function ($element) { |
|
60 | + $result['addressDataProperties'] = array_map(function($element) { |
|
61 | 61 | return $element['attributes']['name']; |
62 | 62 | }, $elems); |
63 | 63 |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | ]; |
524 | 524 | |
525 | 525 | $fpsTraverse = null; |
526 | - $fpsTraverse = function ($privName, $privInfo, $concrete, &$flat) use (&$fpsTraverse) { |
|
526 | + $fpsTraverse = function($privName, $privInfo, $concrete, &$flat) use (&$fpsTraverse) { |
|
527 | 527 | $myPriv = [ |
528 | 528 | 'privilege' => $privName, |
529 | 529 | 'abstract' => isset($privInfo['abstract']) && $privInfo['abstract'], |
@@ -782,7 +782,7 @@ discard block |
||
782 | 782 | $server->on('report', [$this, 'report']); |
783 | 783 | $server->on('method:ACL', [$this, 'httpAcl']); |
784 | 784 | $server->on('onHTMLActionsPanel', [$this, 'htmlActionsPanel']); |
785 | - $server->on('getPrincipalByUri', function ($principal, &$uri) { |
|
785 | + $server->on('getPrincipalByUri', function($principal, &$uri) { |
|
786 | 786 | $uri = $this->getPrincipalByUri($principal); |
787 | 787 | |
788 | 788 | // Break event chain |
@@ -953,13 +953,13 @@ discard block |
||
953 | 953 | |
954 | 954 | /* Adding principal properties */ |
955 | 955 | if ($node instanceof IPrincipal) { |
956 | - $propFind->handle('{DAV:}alternate-URI-set', function () use ($node) { |
|
956 | + $propFind->handle('{DAV:}alternate-URI-set', function() use ($node) { |
|
957 | 957 | return new Href($node->getAlternateUriSet()); |
958 | 958 | }); |
959 | - $propFind->handle('{DAV:}principal-URL', function () use ($node) { |
|
959 | + $propFind->handle('{DAV:}principal-URL', function() use ($node) { |
|
960 | 960 | return new Href($node->getPrincipalUrl().'/'); |
961 | 961 | }); |
962 | - $propFind->handle('{DAV:}group-member-set', function () use ($node) { |
|
962 | + $propFind->handle('{DAV:}group-member-set', function() use ($node) { |
|
963 | 963 | $members = $node->getGroupMemberSet(); |
964 | 964 | foreach ($members as $k => $member) { |
965 | 965 | $members[$k] = rtrim($member, '/').'/'; |
@@ -967,7 +967,7 @@ discard block |
||
967 | 967 | |
968 | 968 | return new Href($members); |
969 | 969 | }); |
970 | - $propFind->handle('{DAV:}group-membership', function () use ($node) { |
|
970 | + $propFind->handle('{DAV:}group-membership', function() use ($node) { |
|
971 | 971 | $members = $node->getGroupMembership(); |
972 | 972 | foreach ($members as $k => $member) { |
973 | 973 | $members[$k] = rtrim($member, '/').'/'; |
@@ -978,7 +978,7 @@ discard block |
||
978 | 978 | $propFind->handle('{DAV:}displayname', [$node, 'getDisplayName']); |
979 | 979 | } |
980 | 980 | |
981 | - $propFind->handle('{DAV:}principal-collection-set', function () { |
|
981 | + $propFind->handle('{DAV:}principal-collection-set', function() { |
|
982 | 982 | $val = $this->principalCollectionSet; |
983 | 983 | // Ensuring all collections end with a slash |
984 | 984 | foreach ($val as $k => $v) { |
@@ -987,17 +987,17 @@ discard block |
||
987 | 987 | |
988 | 988 | return new Href($val); |
989 | 989 | }); |
990 | - $propFind->handle('{DAV:}current-user-principal', function () { |
|
990 | + $propFind->handle('{DAV:}current-user-principal', function() { |
|
991 | 991 | if ($url = $this->getCurrentUserPrincipal()) { |
992 | 992 | return new Xml\Property\Principal(Xml\Property\Principal::HREF, $url.'/'); |
993 | 993 | } else { |
994 | 994 | return new Xml\Property\Principal(Xml\Property\Principal::UNAUTHENTICATED); |
995 | 995 | } |
996 | 996 | }); |
997 | - $propFind->handle('{DAV:}supported-privilege-set', function () use ($node) { |
|
997 | + $propFind->handle('{DAV:}supported-privilege-set', function() use ($node) { |
|
998 | 998 | return new Xml\Property\SupportedPrivilegeSet($this->getSupportedPrivilegeSet($node)); |
999 | 999 | }); |
1000 | - $propFind->handle('{DAV:}current-user-privilege-set', function () use ($node, $propFind, $path) { |
|
1000 | + $propFind->handle('{DAV:}current-user-privilege-set', function() use ($node, $propFind, $path) { |
|
1001 | 1001 | if (!$this->checkPrivileges($path, '{DAV:}read-current-user-privilege-set', self::R_PARENT, false)) { |
1002 | 1002 | $propFind->set('{DAV:}current-user-privilege-set', null, 403); |
1003 | 1003 | } else { |
@@ -1006,7 +1006,7 @@ discard block |
||
1006 | 1006 | return new Xml\Property\CurrentUserPrivilegeSet($val); |
1007 | 1007 | } |
1008 | 1008 | }); |
1009 | - $propFind->handle('{DAV:}acl', function () use ($node, $propFind, $path) { |
|
1009 | + $propFind->handle('{DAV:}acl', function() use ($node, $propFind, $path) { |
|
1010 | 1010 | /* The ACL property contains all the permissions */ |
1011 | 1011 | if (!$this->checkPrivileges($path, '{DAV:}read-acl', self::R_PARENT, false)) { |
1012 | 1012 | $propFind->set('{DAV:}acl', null, 403); |
@@ -1016,13 +1016,13 @@ discard block |
||
1016 | 1016 | return new Xml\Property\Acl($this->getACL($node)); |
1017 | 1017 | } |
1018 | 1018 | }); |
1019 | - $propFind->handle('{DAV:}acl-restrictions', function () { |
|
1019 | + $propFind->handle('{DAV:}acl-restrictions', function() { |
|
1020 | 1020 | return new Xml\Property\AclRestrictions(); |
1021 | 1021 | }); |
1022 | 1022 | |
1023 | 1023 | /* Adding ACL properties */ |
1024 | 1024 | if ($node instanceof IACL) { |
1025 | - $propFind->handle('{DAV:}owner', function () use ($node) { |
|
1025 | + $propFind->handle('{DAV:}owner', function() use ($node) { |
|
1026 | 1026 | return new Href($node->getOwner().'/'); |
1027 | 1027 | }); |
1028 | 1028 | } |
@@ -1036,7 +1036,7 @@ discard block |
||
1036 | 1036 | */ |
1037 | 1037 | public function propPatch($path, DAV\PropPatch $propPatch) |
1038 | 1038 | { |
1039 | - $propPatch->handle('{DAV:}group-member-set', function ($value) use ($path) { |
|
1039 | + $propPatch->handle('{DAV:}group-member-set', function($value) use ($path) { |
|
1040 | 1040 | if (is_null($value)) { |
1041 | 1041 | $memberSet = []; |
1042 | 1042 | } elseif ($value instanceof Href) { |
@@ -82,8 +82,7 @@ |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | $namespace = isset($elem['attributes']['namespace']) ? |
85 | - $elem['attributes']['namespace'] : |
|
86 | - 'DAV:'; |
|
85 | + $elem['attributes']['namespace'] : 'DAV:'; |
|
87 | 86 | |
88 | 87 | $propName = '{'.$namespace.'}'.$elem['attributes']['name']; |
89 | 88 |
@@ -86,7 +86,7 @@ |
||
86 | 86 | */ |
87 | 87 | public function toHtml(HtmlOutputHelper $html) |
88 | 88 | { |
89 | - $traverse = function ($privName, $priv) use (&$traverse, $html) { |
|
89 | + $traverse = function($privName, $priv) use (&$traverse, $html) { |
|
90 | 90 | echo '<li>'; |
91 | 91 | echo $html->xmlName($privName); |
92 | 92 | if (isset($priv['abstract']) && $priv['abstract']) { |
@@ -177,7 +177,7 @@ |
||
177 | 177 | */ |
178 | 178 | public function updatePrincipal($path, DAV\PropPatch $propPatch) |
179 | 179 | { |
180 | - $propPatch->handle(array_keys($this->fieldMap), function ($properties) use ($path) { |
|
180 | + $propPatch->handle(array_keys($this->fieldMap), function($properties) use ($path) { |
|
181 | 181 | $query = 'UPDATE '.$this->tableName.' SET '; |
182 | 182 | $first = true; |
183 | 183 |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | $error->setAttribute('xmlns:s', self::NS_SABREDAV); |
264 | 264 | $DOM->appendChild($error); |
265 | 265 | |
266 | - $h = function ($v) { |
|
266 | + $h = function($v) { |
|
267 | 267 | return htmlspecialchars((string) $v, ENT_NOQUOTES, 'UTF-8'); |
268 | 268 | }; |
269 | 269 | |
@@ -1637,7 +1637,7 @@ discard block |
||
1637 | 1637 | { |
1638 | 1638 | $w = $this->xml->getWriter(); |
1639 | 1639 | if (self::$streamMultiStatus) { |
1640 | - return function () use ($fileProperties, $strip404s, $w) { |
|
1640 | + return function() use ($fileProperties, $strip404s, $w) { |
|
1641 | 1641 | $w->openUri('php://output'); |
1642 | 1642 | $this->writeMultiStatus($w, $fileProperties, $strip404s); |
1643 | 1643 | $w->flush(); |
@@ -745,7 +745,7 @@ discard block |
||
745 | 745 | */ |
746 | 746 | public function propFind(PropFind $propFind, INode $node) |
747 | 747 | { |
748 | - $propFind->handle('{DAV:}getlastmodified', function () use ($node) { |
|
748 | + $propFind->handle('{DAV:}getlastmodified', function() use ($node) { |
|
749 | 749 | $lm = $node->getLastModified(); |
750 | 750 | if ($lm) { |
751 | 751 | return new Xml\Property\GetLastModified($lm); |
@@ -760,12 +760,12 @@ discard block |
||
760 | 760 | |
761 | 761 | if ($node instanceof IQuota) { |
762 | 762 | $quotaInfo = null; |
763 | - $propFind->handle('{DAV:}quota-used-bytes', function () use (&$quotaInfo, $node) { |
|
763 | + $propFind->handle('{DAV:}quota-used-bytes', function() use (&$quotaInfo, $node) { |
|
764 | 764 | $quotaInfo = $node->getQuotaInfo(); |
765 | 765 | |
766 | 766 | return $quotaInfo[0]; |
767 | 767 | }); |
768 | - $propFind->handle('{DAV:}quota-available-bytes', function () use (&$quotaInfo, $node) { |
|
768 | + $propFind->handle('{DAV:}quota-available-bytes', function() use (&$quotaInfo, $node) { |
|
769 | 769 | if (!$quotaInfo) { |
770 | 770 | $quotaInfo = $node->getQuotaInfo(); |
771 | 771 | } |
@@ -774,7 +774,7 @@ discard block |
||
774 | 774 | }); |
775 | 775 | } |
776 | 776 | |
777 | - $propFind->handle('{DAV:}supported-report-set', function () use ($propFind) { |
|
777 | + $propFind->handle('{DAV:}supported-report-set', function() use ($propFind) { |
|
778 | 778 | $reports = []; |
779 | 779 | foreach ($this->server->getPlugins() as $plugin) { |
780 | 780 | $reports = array_merge($reports, $plugin->getSupportedReportSet($propFind->getPath())); |
@@ -782,10 +782,10 @@ discard block |
||
782 | 782 | |
783 | 783 | return new Xml\Property\SupportedReportSet($reports); |
784 | 784 | }); |
785 | - $propFind->handle('{DAV:}resourcetype', function () use ($node) { |
|
785 | + $propFind->handle('{DAV:}resourcetype', function() use ($node) { |
|
786 | 786 | return new Xml\Property\ResourceType($this->server->getResourceTypeForNode($node)); |
787 | 787 | }); |
788 | - $propFind->handle('{DAV:}supported-method-set', function () use ($propFind) { |
|
788 | + $propFind->handle('{DAV:}supported-method-set', function() use ($propFind) { |
|
789 | 789 | return new Xml\Property\SupportedMethodSet( |
790 | 790 | $this->server->getAllowedMethods($propFind->getPath()) |
791 | 791 | ); |
@@ -816,7 +816,7 @@ discard block |
||
816 | 816 | */ |
817 | 817 | public function propFindLate(PropFind $propFind, INode $node) |
818 | 818 | { |
819 | - $propFind->handle('{http://calendarserver.org/ns/}getctag', function () use ($propFind) { |
|
819 | + $propFind->handle('{http://calendarserver.org/ns/}getctag', function() use ($propFind) { |
|
820 | 820 | // If we already have a sync-token from the current propFind |
821 | 821 | // request, we can re-use that. |
822 | 822 | $val = $propFind->get('{http://sabredav.org/ns}sync-token'); |