@@ -97,13 +97,13 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | return [ |
| 100 | - 'created' => function ($role) use ($attributes) { |
|
| 100 | + 'created' => function($role) use ($attributes) { |
|
| 101 | 101 | return $attributes['created']->toDateTime()->format('c'); |
| 102 | 102 | }, |
| 103 | - 'changed' => function ($role) use ($attributes) { |
|
| 103 | + 'changed' => function($role) use ($attributes) { |
|
| 104 | 104 | return $attributes['changed']->toDateTime()->format('c'); |
| 105 | 105 | }, |
| 106 | - 'deleted' => function ($role) use ($attributes) { |
|
| 106 | + 'deleted' => function($role) use ($attributes) { |
|
| 107 | 107 | if (false === $attributes['deleted']) { |
| 108 | 108 | return null; |
| 109 | 109 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | 'id' => (string) $attributes['_id'], |
| 127 | 127 | 'name' => $attributes['name'], |
| 128 | 128 | 'namespace' => isset($attributes['namespace']) ? (string) $attributes['namespace'] : null, |
| 129 | - 'member' => array_map(function ($member) { return (string) $member; }, $attributes['member']), |
|
| 129 | + 'member' => array_map(function($member) { return (string) $member; }, $attributes['member']), |
|
| 130 | 130 | ]; |
| 131 | 131 | } |
| 132 | 132 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | 'name' => (string) $attributes['username'], |
| 149 | 149 | 'admin' => (bool) $attributes['admin'], |
| 150 | 150 | 'namespace' => isset($attributes['namespace']) ? (string) $attributes['namespace'] : null, |
| 151 | - 'mail' => function ($role) use ($attributes, $user) { |
|
| 151 | + 'mail' => function($role) use ($attributes, $user) { |
|
| 152 | 152 | if (!isset($attributes['mail'])) { |
| 153 | 153 | return null; |
| 154 | 154 | } |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | 'locale' => isset($attributes['locale']) ? (string) $attributes['locale'] : null, |
| 163 | 163 | 'hard_quota' => isset($attributes['hard_quota']) ? (int) $attributes['hard_quota'] : null, |
| 164 | 164 | 'soft_quota' => isset($attributes['soft_quota']) ? (int) $attributes['soft_quota'] : null, |
| 165 | - 'available' => function ($role) use (&$quota, $attributes, $user) { |
|
| 165 | + 'available' => function($role) use (&$quota, $attributes, $user) { |
|
| 166 | 166 | $quota === null ? $quota = $role->getQuotaUsage() : null; |
| 167 | 167 | if ($attributes['_id'] == $user->getId() || $user->isAdmin()) { |
| 168 | 168 | return $quota['available']; |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | |
| 171 | 171 | return null; |
| 172 | 172 | }, |
| 173 | - 'used' => function ($role) use (&$quota, $attributes, $user) { |
|
| 173 | + 'used' => function($role) use (&$quota, $attributes, $user) { |
|
| 174 | 174 | $quota === null ? $quota = $role->getQuotaUsage() : null; |
| 175 | 175 | if ($attributes['_id'] == $user->getId() || $user->isAdmin()) { |
| 176 | 176 | return $quota['used']; |
@@ -178,14 +178,14 @@ discard block |
||
| 178 | 178 | |
| 179 | 179 | return null; |
| 180 | 180 | }, |
| 181 | - 'has_password' => function ($role) use ($user, $attributes) { |
|
| 181 | + 'has_password' => function($role) use ($user, $attributes) { |
|
| 182 | 182 | if ($attributes['_id'] == $user->getId() || $user->isAdmin()) { |
| 183 | 183 | return $role->hasPassword(); |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | return null; |
| 187 | 187 | }, |
| 188 | - 'auth' => function () use ($user) { |
|
| 188 | + 'auth' => function() use ($user) { |
|
| 189 | 189 | $identity = $user->getIdentity(); |
| 190 | 190 | if ($identity === null) { |
| 191 | 191 | return null; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | if ( |
| 83 | 83 | !($this->auth->getIdentity()->getAdapter() instanceof AuthNone)) { |
| 84 | - $this->auth->getIdentity()->getAttributeMap()->addMapper('binary', function ($value) { |
|
| 84 | + $this->auth->getIdentity()->getAttributeMap()->addMapper('binary', function($value) { |
|
| 85 | 85 | return new Binary($value, Binary::TYPE_GENERIC); |
| 86 | 86 | }); |
| 87 | 87 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | */ |
| 139 | 139 | protected function setExceptionHandler(): self |
| 140 | 140 | { |
| 141 | - set_exception_handler(function ($e) { |
|
| 141 | + set_exception_handler(function($e) { |
|
| 142 | 142 | $this->logger->emergency('uncaught exception: '.$e->getMessage(), [ |
| 143 | 143 | 'category' => get_class($this), |
| 144 | 144 | 'exception' => $e, |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | - return $this->bulk($id, $p, function ($node) use ($parent, $conflict, $move) { |
|
| 191 | + return $this->bulk($id, $p, function($node) use ($parent, $conflict, $move) { |
|
| 192 | 192 | if (true === $move) { |
| 193 | 193 | $node = $node->setParent($parent, $conflict); |
| 194 | 194 | } |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | |
| 266 | 266 | $node = $this->_getNode($id, $p); |
| 267 | 267 | if ($node instanceof Collection) { |
| 268 | - return (new Response())->setBody(function () use ($node) { |
|
| 268 | + return (new Response())->setBody(function() use ($node) { |
|
| 269 | 269 | $node->getZip(); |
| 270 | 270 | }); |
| 271 | 271 | } |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | return $response->setOutputFormat(null) |
| 287 | - ->setBody(function () use ($node, $encode, $offset, $length) { |
|
| 287 | + ->setBody(function() use ($node, $encode, $offset, $length) { |
|
| 288 | 288 | $mime = $node->getContentType(); |
| 289 | 289 | $stream = $node->get(); |
| 290 | 290 | $name = $node->getName(); |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | */ |
| 353 | 353 | public function postReadonly($id = null, $p = null, bool $readonly = true): Response |
| 354 | 354 | { |
| 355 | - return $this->bulk($id, $p, function ($node) use ($readonly) { |
|
| 355 | + return $this->bulk($id, $p, function($node) use ($readonly) { |
|
| 356 | 356 | $node->setReadonly($readonly); |
| 357 | 357 | |
| 358 | 358 | return ['status' => 204]; |
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | */ |
| 598 | 598 | public function postMetaAttributes(?string $id = null, ?string $p = null): Response |
| 599 | 599 | { |
| 600 | - return $this->bulk($id, $p, function ($node) { |
|
| 600 | + return $this->bulk($id, $p, function($node) { |
|
| 601 | 601 | $node->setMetaAttributes($_POST); |
| 602 | 602 | |
| 603 | 603 | return ['status' => 204]; |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | throw new Exception\NotFound('destination collection was not found or is not a collection', Exception\NotFound::DESTINATION_NOT_FOUND); |
| 677 | 677 | } |
| 678 | 678 | |
| 679 | - return $this->bulk($id, $p, function ($node) use ($parent, $conflict) { |
|
| 679 | + return $this->bulk($id, $p, function($node) use ($parent, $conflict) { |
|
| 680 | 680 | $result = $node->copyTo($parent, $conflict); |
| 681 | 681 | |
| 682 | 682 | return [ |
@@ -734,7 +734,7 @@ discard block |
||
| 734 | 734 | throw new Exception\NotFound('destination collection was not found or is not a collection', Exception\NotFound::DESTINATION_NOT_FOUND); |
| 735 | 735 | } |
| 736 | 736 | |
| 737 | - return $this->bulk($id, $p, function ($node) use ($parent, $conflict) { |
|
| 737 | + return $this->bulk($id, $p, function($node) use ($parent, $conflict) { |
|
| 738 | 738 | $result = $node->setParent($parent, $conflict); |
| 739 | 739 | if (NodeInterface::CONFLICT_RENAME === $conflict) { |
| 740 | 740 | return [ |
@@ -789,7 +789,7 @@ discard block |
||
| 789 | 789 | $at = $this->_verifyAttributes(['destroy' => $at])['destroy']; |
| 790 | 790 | } |
| 791 | 791 | |
| 792 | - return $this->bulk($id, $p, function ($node) use ($force, $ignore_flag, $at) { |
|
| 792 | + return $this->bulk($id, $p, function($node) use ($force, $ignore_flag, $at) { |
|
| 793 | 793 | if (null === $at) { |
| 794 | 794 | $node->delete($force && $node->isDeleted() || $force && $ignore_flag); |
| 795 | 795 | } else { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | if ($index === $chunks) { |
| 99 | 99 | $attributes = compact('changed', 'created', 'readonly', 'meta', 'acl'); |
| 100 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
| 100 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
| 101 | 101 | $attributes = $this->_verifyAttributes($attributes); |
| 102 | 102 | |
| 103 | 103 | return $this->_put($session, $id, $collection, $name, $attributes, $conflict); |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | $parent = $this->getParent($id, $collection); |
| 130 | 130 | $session = $this->session_factory->add($this->server->getIdentity(), $parent, $input); |
| 131 | 131 | $attributes = compact('changed', 'created', 'readonly', 'meta', 'acl'); |
| 132 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
| 132 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
| 133 | 133 | $attributes = $this->_verifyAttributes($attributes); |
| 134 | 134 | |
| 135 | 135 | return $this->_put($session, $id, $collection, $name, $attributes, $conflict); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - return $this->bulk($id, function ($node) use ($parent, $conflict, $move) { |
|
| 111 | + return $this->bulk($id, function($node) use ($parent, $conflict, $move) { |
|
| 112 | 112 | if (true === $move) { |
| 113 | 113 | $node = $node->setParent($parent, $conflict); |
| 114 | 114 | } |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | return (new Response())->setCode(200)->setBody($result); |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | - return $this->bulk($id, function ($node) use ($attributes) { |
|
| 178 | + return $this->bulk($id, function($node) use ($attributes) { |
|
| 179 | 179 | return [ |
| 180 | 180 | 'code' => 200, |
| 181 | 181 | 'data' => $this->node_decorator->decorate($node, $attributes), |
@@ -211,11 +211,11 @@ discard block |
||
| 211 | 211 | public function patch(string $id, ?string $name = null, ?array $meta = null, ?bool $readonly = null, ?array $filter = null, $lock = null): Response |
| 212 | 212 | { |
| 213 | 213 | $attributes = compact('name', 'meta', 'readonly', 'filter', 'lock'); |
| 214 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
| 214 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
| 215 | 215 | |
| 216 | 216 | $lock = $_SERVER['HTTP_LOCK_TOKEN'] ?? null; |
| 217 | 217 | |
| 218 | - return $this->bulk($id, function ($node) use ($attributes, $lock) { |
|
| 218 | + return $this->bulk($id, function($node) use ($attributes, $lock) { |
|
| 219 | 219 | foreach ($attributes as $attribute => $value) { |
| 220 | 220 | switch ($attribute) { |
| 221 | 221 | case 'name': |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | throw new Exception\NotFound('destination collection was not found or is not a collection', Exception\NotFound::DESTINATION_NOT_FOUND); |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | - return $this->bulk($id, function ($node) use ($parent, $conflict) { |
|
| 271 | + return $this->bulk($id, function($node) use ($parent, $conflict) { |
|
| 272 | 272 | $result = $node->copyTo($parent, $conflict); |
| 273 | 273 | |
| 274 | 274 | return [ |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | throw new Exception\NotFound('destination collection was not found or is not a collection', Exception\NotFound::DESTINATION_NOT_FOUND); |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | - return $this->bulk($id, function ($node) use ($parent, $conflict) { |
|
| 295 | + return $this->bulk($id, function($node) use ($parent, $conflict) { |
|
| 296 | 296 | $result = $node->setParent($parent, $conflict); |
| 297 | 297 | |
| 298 | 298 | return [ |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | $at = $this->_verifyAttributes(['destroy' => $at])['destroy']; |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | - return $this->bulk($id, function ($node) use ($force, $ignore_flag, $at) { |
|
| 320 | + return $this->bulk($id, function($node) use ($force, $ignore_flag, $at) { |
|
| 321 | 321 | if (null === $at) { |
| 322 | 322 | $node->delete($force && $node->isDeleted() || $force && $ignore_flag); |
| 323 | 323 | } else { |
@@ -263,7 +263,7 @@ |
||
| 263 | 263 | $response = (new Response()) |
| 264 | 264 | ->setCode(200) |
| 265 | 265 | ->setHeader('X-WOPI-ItemVersion', (string) $file->getVersion()) |
| 266 | - ->setBody(function () use ($stream) { |
|
| 266 | + ->setBody(function() use ($stream) { |
|
| 267 | 267 | if ($stream === null) { |
| 268 | 268 | echo ''; |
| 269 | 269 | |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | $tpl = new Template($type); |
| 70 | 70 | |
| 71 | 71 | $attributes = compact('readonly', 'meta'); |
| 72 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
| 72 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
| 73 | 73 | |
| 74 | 74 | $stream = $tpl->get(); |
| 75 | 75 | $session = $this->session_factory->add($this->server->getIdentity(), $parent, $stream); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | $subscription = null; |
| 36 | 36 | |
| 37 | - $decorator->addDecorator('subscription', function ($node) use ($notifier, $server, &$subscription) { |
|
| 37 | + $decorator->addDecorator('subscription', function($node) use ($notifier, $server, &$subscription) { |
|
| 38 | 38 | $subscription = $notifier->getSubscription($node, $server->getIdentity()); |
| 39 | 39 | if ($subscription === null) { |
| 40 | 40 | return false; |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | return true; |
| 44 | 44 | }); |
| 45 | 45 | |
| 46 | - $decorator->addDecorator('subscription_exclude_me', function ($node) use (&$subscription) { |
|
| 46 | + $decorator->addDecorator('subscription_exclude_me', function($node) use (&$subscription) { |
|
| 47 | 47 | if ($subscription === null) { |
| 48 | 48 | return false; |
| 49 | 49 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | return $subscription['exclude_me']; |
| 52 | 52 | }); |
| 53 | 53 | |
| 54 | - $decorator->addDecorator('subscription_recursive', function ($node) use (&$subscription) { |
|
| 54 | + $decorator->addDecorator('subscription_recursive', function($node) use (&$subscription) { |
|
| 55 | 55 | if (!($node instanceof Collection)) { |
| 56 | 56 | return null; |
| 57 | 57 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | return $subscription['recursive']; |
| 64 | 64 | }); |
| 65 | 65 | |
| 66 | - $decorator->addDecorator('subscription_throttle', function ($node) use ($notifier, &$subscription) { |
|
| 66 | + $decorator->addDecorator('subscription_throttle', function($node) use ($notifier, &$subscription) { |
|
| 67 | 67 | if ($subscription === null) { |
| 68 | 68 | return $notifier->getThrottleTime(); |
| 69 | 69 | } |
@@ -420,7 +420,7 @@ |
||
| 420 | 420 | |
| 421 | 421 | if ($node instanceof Collection && $recursive === true) { |
| 422 | 422 | $db = $this->db; |
| 423 | - $node->doRecursiveAction(function ($child) use ($db, $node_id, $user_id) { |
|
| 423 | + $node->doRecursiveAction(function($child) use ($db, $node_id, $user_id) { |
|
| 424 | 424 | $db->subscription->deleteOne([ |
| 425 | 425 | 'user' => $user_id, |
| 426 | 426 | 'node' => $node_id, |