@@ -285,7 +285,7 @@ |
||
285 | 285 | { |
286 | 286 | $values = $this->getParts(); |
287 | 287 | |
288 | - $map = function ($items) use ($values, $writer) { |
|
288 | + $map = function($items) use ($values, $writer) { |
|
289 | 289 | foreach ($items as $i => $item) { |
290 | 290 | $writer->writeElement( |
291 | 291 | $item, |
@@ -62,7 +62,7 @@ |
||
62 | 62 | public function setXmlValue(array $value) |
63 | 63 | { |
64 | 64 | $value = array_map( |
65 | - function ($value) { |
|
65 | + function($value) { |
|
66 | 66 | return 'true' === $value; |
67 | 67 | }, |
68 | 68 | $value |
@@ -300,7 +300,7 @@ |
||
300 | 300 | } |
301 | 301 | |
302 | 302 | $value .= 'T' . $r('hour') . $r('minute') . $r('second') . |
303 | - $r('timezone'); |
|
303 | + $r('timezone'); |
|
304 | 304 | } |
305 | 305 | |
306 | 306 | $writer->writeElement($valueType, $value); |
@@ -237,12 +237,12 @@ |
||
237 | 237 | $value = ''; |
238 | 238 | |
239 | 239 | // $d = defined |
240 | - $d = function ($part) use ($parts) { |
|
240 | + $d = function($part) use ($parts) { |
|
241 | 241 | return !is_null($parts[$part]); |
242 | 242 | }; |
243 | 243 | |
244 | 244 | // $r = read |
245 | - $r = function ($part) use ($parts) { |
|
245 | + $r = function($part) use ($parts) { |
|
246 | 246 | return $parts[$part]; |
247 | 247 | }; |
248 | 248 |
@@ -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 |
@@ -954,13 +954,13 @@ discard block |
||
954 | 954 | |
955 | 955 | /* Adding principal properties */ |
956 | 956 | if ($node instanceof IPrincipal) { |
957 | - $propFind->handle('{DAV:}alternate-URI-set', function () use ($node) { |
|
957 | + $propFind->handle('{DAV:}alternate-URI-set', function() use ($node) { |
|
958 | 958 | return new Href($node->getAlternateUriSet()); |
959 | 959 | }); |
960 | - $propFind->handle('{DAV:}principal-URL', function () use ($node) { |
|
960 | + $propFind->handle('{DAV:}principal-URL', function() use ($node) { |
|
961 | 961 | return new Href($node->getPrincipalUrl() . '/'); |
962 | 962 | }); |
963 | - $propFind->handle('{DAV:}group-member-set', function () use ($node) { |
|
963 | + $propFind->handle('{DAV:}group-member-set', function() use ($node) { |
|
964 | 964 | $members = $node->getGroupMemberSet(); |
965 | 965 | foreach ($members as $k => $member) { |
966 | 966 | $members[$k] = rtrim($member, '/') . '/'; |
@@ -968,7 +968,7 @@ discard block |
||
968 | 968 | |
969 | 969 | return new Href($members); |
970 | 970 | }); |
971 | - $propFind->handle('{DAV:}group-membership', function () use ($node) { |
|
971 | + $propFind->handle('{DAV:}group-membership', function() use ($node) { |
|
972 | 972 | $members = $node->getGroupMembership(); |
973 | 973 | foreach ($members as $k => $member) { |
974 | 974 | $members[$k] = rtrim($member, '/') . '/'; |
@@ -979,7 +979,7 @@ discard block |
||
979 | 979 | $propFind->handle('{DAV:}displayname', [$node, 'getDisplayName']); |
980 | 980 | } |
981 | 981 | |
982 | - $propFind->handle('{DAV:}principal-collection-set', function () { |
|
982 | + $propFind->handle('{DAV:}principal-collection-set', function() { |
|
983 | 983 | $val = $this->principalCollectionSet; |
984 | 984 | // Ensuring all collections end with a slash |
985 | 985 | foreach ($val as $k => $v) { |
@@ -988,17 +988,17 @@ discard block |
||
988 | 988 | |
989 | 989 | return new Href($val); |
990 | 990 | }); |
991 | - $propFind->handle('{DAV:}current-user-principal', function () { |
|
991 | + $propFind->handle('{DAV:}current-user-principal', function() { |
|
992 | 992 | if ($url = $this->getCurrentUserPrincipal()) { |
993 | 993 | return new Xml\Property\Principal(Xml\Property\Principal::HREF, $url . '/'); |
994 | 994 | } else { |
995 | 995 | return new Xml\Property\Principal(Xml\Property\Principal::UNAUTHENTICATED); |
996 | 996 | } |
997 | 997 | }); |
998 | - $propFind->handle('{DAV:}supported-privilege-set', function () use ($node) { |
|
998 | + $propFind->handle('{DAV:}supported-privilege-set', function() use ($node) { |
|
999 | 999 | return new Xml\Property\SupportedPrivilegeSet($this->getSupportedPrivilegeSet($node)); |
1000 | 1000 | }); |
1001 | - $propFind->handle('{DAV:}current-user-privilege-set', function () use ($node, $propFind, $path) { |
|
1001 | + $propFind->handle('{DAV:}current-user-privilege-set', function() use ($node, $propFind, $path) { |
|
1002 | 1002 | if (!$this->checkPrivileges($path, '{DAV:}read-current-user-privilege-set', self::R_PARENT, false)) { |
1003 | 1003 | $propFind->set('{DAV:}current-user-privilege-set', null, 403); |
1004 | 1004 | } else { |
@@ -1007,7 +1007,7 @@ discard block |
||
1007 | 1007 | return new Xml\Property\CurrentUserPrivilegeSet($val); |
1008 | 1008 | } |
1009 | 1009 | }); |
1010 | - $propFind->handle('{DAV:}acl', function () use ($node, $propFind, $path) { |
|
1010 | + $propFind->handle('{DAV:}acl', function() use ($node, $propFind, $path) { |
|
1011 | 1011 | /* The ACL property contains all the permissions */ |
1012 | 1012 | if (!$this->checkPrivileges($path, '{DAV:}read-acl', self::R_PARENT, false)) { |
1013 | 1013 | $propFind->set('{DAV:}acl', null, 403); |
@@ -1017,13 +1017,13 @@ discard block |
||
1017 | 1017 | return new Xml\Property\Acl($this->getACL($node)); |
1018 | 1018 | } |
1019 | 1019 | }); |
1020 | - $propFind->handle('{DAV:}acl-restrictions', function () { |
|
1020 | + $propFind->handle('{DAV:}acl-restrictions', function() { |
|
1021 | 1021 | return new Xml\Property\AclRestrictions(); |
1022 | 1022 | }); |
1023 | 1023 | |
1024 | 1024 | /* Adding ACL properties */ |
1025 | 1025 | if ($node instanceof IACL) { |
1026 | - $propFind->handle('{DAV:}owner', function () use ($node) { |
|
1026 | + $propFind->handle('{DAV:}owner', function() use ($node) { |
|
1027 | 1027 | return new Href($node->getOwner() . '/'); |
1028 | 1028 | }); |
1029 | 1029 | } |
@@ -1037,7 +1037,7 @@ discard block |
||
1037 | 1037 | */ |
1038 | 1038 | public function propPatch($path, DAV\PropPatch $propPatch) |
1039 | 1039 | { |
1040 | - $propPatch->handle('{DAV:}group-member-set', function ($value) use ($path) { |
|
1040 | + $propPatch->handle('{DAV:}group-member-set', function($value) use ($path) { |
|
1041 | 1041 | if (is_null($value)) { |
1042 | 1042 | $memberSet = []; |
1043 | 1043 | } 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 |
@@ -116,7 +116,7 @@ |
||
116 | 116 | */ |
117 | 117 | public function propPatch($path, PropPatch $propPatch) |
118 | 118 | { |
119 | - $propPatch->handleRemaining(function ($properties) use ($path) { |
|
119 | + $propPatch->handleRemaining(function($properties) use ($path) { |
|
120 | 120 | if ('pgsql' === $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME)) { |
121 | 121 | $updateSql = <<<SQL |
122 | 122 | INSERT INTO {$this->tableName} (path, name, valuetype, value) |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | $self = $this; |
58 | 58 | |
59 | - $server->on('report', function ($reportName, $dom, $uri) use ($self) { |
|
59 | + $server->on('report', function($reportName, $dom, $uri) use ($self) { |
|
60 | 60 | if ('{DAV:}sync-collection' === $reportName) { |
61 | 61 | $this->server->transactionType = 'report-sync-collection'; |
62 | 62 | $self->syncCollection($uri, $dom); |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | */ |
189 | 189 | public function propFind(DAV\PropFind $propFind, DAV\INode $node) |
190 | 190 | { |
191 | - $propFind->handle('{DAV:}sync-token', function () use ($node) { |
|
191 | + $propFind->handle('{DAV:}sync-token', function() use ($node) { |
|
192 | 192 | if (!$node instanceof ISyncCollection || !$token = $node->getSyncToken()) { |
193 | 193 | return; |
194 | 194 | } |