@@ -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 { |
@@ -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, |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | $node_decorator = $this->node_decorator; |
| 59 | 59 | $notifier = $this->notifier; |
| 60 | 60 | |
| 61 | - return $this->bulk($id, function ($node) use ($node_decorator, $notifier, $subscribe, $exclude_me, $recursive, $throttle) { |
|
| 61 | + return $this->bulk($id, function($node) use ($node_decorator, $notifier, $subscribe, $exclude_me, $recursive, $throttle) { |
|
| 62 | 62 | $notifier->subscribeNode($node, $subscribe, $exclude_me, $recursive, $throttle); |
| 63 | 63 | |
| 64 | 64 | return [ |
@@ -113,20 +113,20 @@ discard block |
||
| 113 | 113 | 'mime' => (string) $attributes['mime'], |
| 114 | 114 | 'readonly' => (bool) $attributes['readonly'], |
| 115 | 115 | 'directory' => $node instanceof Collection, |
| 116 | - 'meta' => function ($node) { |
|
| 116 | + 'meta' => function($node) { |
|
| 117 | 117 | return (object) $node->getMetaAttributes(); |
| 118 | 118 | }, |
| 119 | - 'size' => function ($node) { |
|
| 119 | + 'size' => function($node) { |
|
| 120 | 120 | return $node->getSize(); |
| 121 | 121 | }, |
| 122 | - 'path' => function ($node) { |
|
| 122 | + 'path' => function($node) { |
|
| 123 | 123 | try { |
| 124 | 124 | return $node->getPath(); |
| 125 | 125 | } catch (\Exception $e) { |
| 126 | 126 | return null; |
| 127 | 127 | } |
| 128 | 128 | }, |
| 129 | - 'parent' => function ($node) { |
|
| 129 | + 'parent' => function($node) { |
|
| 130 | 130 | $parent = $node->getParent(); |
| 131 | 131 | |
| 132 | 132 | if (null === $parent || $parent->isRoot()) { |
@@ -135,10 +135,10 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | return $this->decorate($node->getParent(), ['id', 'name', '_links']); |
| 137 | 137 | }, |
| 138 | - 'access' => function ($node) use ($acl) { |
|
| 138 | + 'access' => function($node) use ($acl) { |
|
| 139 | 139 | return $acl->getAclPrivilege($node); |
| 140 | 140 | }, |
| 141 | - 'lock' => function ($node) use ($server, $decorator, $attributes) { |
|
| 141 | + 'lock' => function($node) use ($server, $decorator, $attributes) { |
|
| 142 | 142 | if (!$node->isLocked()) { |
| 143 | 143 | return null; |
| 144 | 144 | } |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | 'id' => $lock['id'], |
| 164 | 164 | ]; |
| 165 | 165 | }, |
| 166 | - 'share' => function ($node) use ($fs) { |
|
| 166 | + 'share' => function($node) use ($fs) { |
|
| 167 | 167 | if ($node->isShared() || !$node->isSpecial()) { |
| 168 | 168 | return null; |
| 169 | 169 | } |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | return null; |
| 175 | 175 | } |
| 176 | 176 | }, |
| 177 | - 'sharename' => function ($node) { |
|
| 177 | + 'sharename' => function($node) { |
|
| 178 | 178 | if (!$node->isShared()) { |
| 179 | 179 | return null; |
| 180 | 180 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | return null; |
| 186 | 186 | } |
| 187 | 187 | }, |
| 188 | - 'shareowner' => function ($node) use ($server, $fs, $decorator) { |
|
| 188 | + 'shareowner' => function($node) use ($server, $fs, $decorator) { |
|
| 189 | 189 | if (!$node->isSpecial()) { |
| 190 | 190 | return null; |
| 191 | 191 | } |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | return null; |
| 200 | 200 | } |
| 201 | 201 | }, |
| 202 | - 'owner' => function ($node) use ($server, $decorator) { |
|
| 202 | + 'owner' => function($node) use ($server, $decorator) { |
|
| 203 | 203 | try { |
| 204 | 204 | return $decorator->decorate( |
| 205 | 205 | $server->getUserById($node->getOwner()), |
@@ -220,20 +220,20 @@ discard block |
||
| 220 | 220 | protected function getTimeAttributes(NodeInterface $node, array $attributes): array |
| 221 | 221 | { |
| 222 | 222 | return [ |
| 223 | - 'created' => function ($node) use ($attributes) { |
|
| 223 | + 'created' => function($node) use ($attributes) { |
|
| 224 | 224 | return $attributes['created']->toDateTime()->format('c'); |
| 225 | 225 | }, |
| 226 | - 'changed' => function ($node) use ($attributes) { |
|
| 226 | + 'changed' => function($node) use ($attributes) { |
|
| 227 | 227 | return $attributes['changed']->toDateTime()->format('c'); |
| 228 | 228 | }, |
| 229 | - 'deleted' => function ($node) use ($attributes) { |
|
| 229 | + 'deleted' => function($node) use ($attributes) { |
|
| 230 | 230 | if (false === $attributes['deleted']) { |
| 231 | 231 | return null; |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | return $attributes['deleted']->toDateTime()->format('c'); |
| 235 | 235 | }, |
| 236 | - 'destroy' => function ($node) use ($attributes) { |
|
| 236 | + 'destroy' => function($node) use ($attributes) { |
|
| 237 | 237 | if (null === $attributes['destroy']) { |
| 238 | 238 | return null; |
| 239 | 239 | } |
@@ -261,14 +261,14 @@ discard block |
||
| 261 | 261 | return [ |
| 262 | 262 | 'shared' => $node->isShared(), |
| 263 | 263 | 'reference' => $node->isReference(), |
| 264 | - 'filter' => function ($node) use ($attributes) { |
|
| 264 | + 'filter' => function($node) use ($attributes) { |
|
| 265 | 265 | if (null === $attributes['filter']) { |
| 266 | 266 | return null; |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | return json_decode($attributes['filter'], true, 512, JSON_THROW_ON_ERROR); |
| 270 | 270 | }, |
| 271 | - 'mount' => function ($node) use ($fs, $attributes) { |
|
| 271 | + 'mount' => function($node) use ($fs, $attributes) { |
|
| 272 | 272 | $mount = $node->getAttributes()['mount']; |
| 273 | 273 | |
| 274 | 274 | if (!$node->isMounted() && !$node->isReference()) { |
@@ -44,16 +44,16 @@ |
||
| 44 | 44 | * @param array |
| 45 | 45 | **/ |
| 46 | 46 | protected $temp_files = [ |
| 47 | - '/^\._(.*)$/', // OS/X resource forks |
|
| 48 | - '/^.DS_Store$/', // OS/X custom folder settings |
|
| 47 | + '/^\._(.*)$/', // OS/X resource forks |
|
| 48 | + '/^.DS_Store$/', // OS/X custom folder settings |
|
| 49 | 49 | '/^desktop.ini$/', // Windows custom folder settings |
| 50 | - '/^Thumbs.db$/', // Windows thumbnail cache |
|
| 51 | - '/^.(.*).swpx$/', // ViM temporary files |
|
| 52 | - '/^.(.*).swx$/', // ViM temporary files |
|
| 53 | - '/^.(.*).swp$/', // ViM temporary files |
|
| 54 | - '/^\.dat(.*)$/', // Smultron seems to create these |
|
| 50 | + '/^Thumbs.db$/', // Windows thumbnail cache |
|
| 51 | + '/^.(.*).swpx$/', // ViM temporary files |
|
| 52 | + '/^.(.*).swx$/', // ViM temporary files |
|
| 53 | + '/^.(.*).swp$/', // ViM temporary files |
|
| 54 | + '/^\.dat(.*)$/', // Smultron seems to create these |
|
| 55 | 55 | '/^~lock.(.*)#$/', // Windows 7 lockfiles |
| 56 | - '/^\~\$/', // Temporary office files |
|
| 56 | + '/^\~\$/', // Temporary office files |
|
| 57 | 57 | ]; |
| 58 | 58 | |
| 59 | 59 | /** |