@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * balloon |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * balloon |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * balloon |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | } |
73 | 73 | }); |
74 | 74 | |
75 | - $node_decorator_v2->addDecorator('sharelink_token', function ($node) use ($sharelink) { |
|
75 | + $node_decorator_v2->addDecorator('sharelink_token', function($node) use ($sharelink) { |
|
76 | 76 | $attributes = $sharelink->getSharelink($node); |
77 | 77 | |
78 | 78 | if (isset($attributes['token'])) { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | }); |
82 | 82 | |
83 | - $node_decorator_v2->addDecorator('sharelink_expire', function ($node) use ($sharelink) { |
|
83 | + $node_decorator_v2->addDecorator('sharelink_expire', function($node) use ($sharelink) { |
|
84 | 84 | $attributes = $sharelink->getSharelink($node); |
85 | 85 | |
86 | 86 | if (isset($attributes['expiration'])) { |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | } |
91 | 91 | }); |
92 | 92 | |
93 | - $node_decorator_v1->addDecorator('sharelink', function ($node) use ($sharelink) { |
|
93 | + $node_decorator_v1->addDecorator('sharelink', function($node) use ($sharelink) { |
|
94 | 94 | return isset($sharelink->getSharelink($node)['token']); |
95 | 95 | }); |
96 | 96 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * balloon |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * balloon |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * balloon |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | } |
271 | 271 | |
272 | 272 | $attributes = compact('namespace', 'optional'); |
273 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
273 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
274 | 274 | |
275 | 275 | $id = $this->server->addGroup($name, $member, $attributes); |
276 | 276 | $result = $this->decorator->decorate($this->server->getGroupById($id)); |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | public function patch(string $id, ?array $member = null, ?string $namespace = null, ?array $optional = null): Response |
310 | 310 | { |
311 | 311 | $attributes = compact('namespace', 'optional', 'name', 'member'); |
312 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
312 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
313 | 313 | |
314 | 314 | $group = $this->_getGroup($id, true); |
315 | 315 | $group->setAttributes($attributes); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * balloon |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | } |
188 | 188 | } |
189 | 189 | |
190 | - return $this->bulk($id, $p, function ($node) use ($parent, $conflict, $move) { |
|
190 | + return $this->bulk($id, $p, function($node) use ($parent, $conflict, $move) { |
|
191 | 191 | if (true === $move) { |
192 | 192 | $node = $node->setParent($parent, $conflict); |
193 | 193 | } |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | |
281 | 281 | return $response |
282 | 282 | ->setOutputFormat(null) |
283 | - ->setBody(function () use ($node, $encode, $offset, $limit) { |
|
283 | + ->setBody(function() use ($node, $encode, $offset, $limit) { |
|
284 | 284 | $stream = $node->get(); |
285 | 285 | $name = $node->getName(); |
286 | 286 | |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | return (new Response())->setCode(200)->setBody($result); |
430 | 430 | } |
431 | 431 | |
432 | - return $this->bulk($id, $p, function ($node) use ($attributes) { |
|
432 | + return $this->bulk($id, $p, function($node) use ($attributes) { |
|
433 | 433 | return [ |
434 | 434 | 'code' => 200, |
435 | 435 | 'data' => $this->node_decorator->decorate($node, $attributes), |
@@ -543,9 +543,9 @@ discard block |
||
543 | 543 | public function patch(?string $name = null, ?array $meta = null, ?bool $readonly = null, ?array $filter = null, ?string $id = null, ?string $p = null): Response |
544 | 544 | { |
545 | 545 | $attributes = compact('name', 'meta', 'readonly', 'filter'); |
546 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
546 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
547 | 547 | |
548 | - return $this->bulk($id, $p, function ($node) use ($attributes) { |
|
548 | + return $this->bulk($id, $p, function($node) use ($attributes) { |
|
549 | 549 | foreach ($attributes as $attribute => $value) { |
550 | 550 | switch ($attribute) { |
551 | 551 | case 'name': |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | ); |
628 | 628 | } |
629 | 629 | |
630 | - return $this->bulk($id, $p, function ($node) use ($parent, $conflict) { |
|
630 | + return $this->bulk($id, $p, function($node) use ($parent, $conflict) { |
|
631 | 631 | $parent = $node->getParent(); |
632 | 632 | $result = $node->copyTo($parent, $conflict); |
633 | 633 | |
@@ -692,7 +692,7 @@ discard block |
||
692 | 692 | ); |
693 | 693 | } |
694 | 694 | |
695 | - return $this->bulk($id, $p, function ($node) use ($parent, $conflict) { |
|
695 | + return $this->bulk($id, $p, function($node) use ($parent, $conflict) { |
|
696 | 696 | $result = $node->setParent($parent, $conflict); |
697 | 697 | |
698 | 698 | return [ |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | $at = $this->_verifyAttributes(['destroy' => $at])['destroy']; |
747 | 747 | } |
748 | 748 | |
749 | - return $this->bulk($id, $p, function ($node) use ($force, $ignore_flag, $at) { |
|
749 | + return $this->bulk($id, $p, function($node) use ($force, $ignore_flag, $at) { |
|
750 | 750 | if (null === $at) { |
751 | 751 | $node->delete($force && $node->isDeleted() || $force && $ignore_flag); |
752 | 752 | } else { |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * balloon |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | |
343 | 343 | try { |
344 | 344 | $attributes = compact('changed', 'created', 'readonly', 'meta'); |
345 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
345 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
346 | 346 | $attributes = $this->_verifyAttributes($attributes); |
347 | 347 | |
348 | 348 | return $this->_put($file, $id, $p, $collection, $name, $attributes, $conflict); |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | $content = fopen('php://input', 'rb'); |
464 | 464 | |
465 | 465 | $attributes = compact('changed', 'created', 'readonly', 'meta'); |
466 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
466 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
467 | 467 | $attributes = $this->_verifyAttributes($attributes); |
468 | 468 | |
469 | 469 | return $this->_put($content, $id, $p, $collection, $name, $attributes, $conflict); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * balloon |
@@ -141,20 +141,20 @@ discard block |
||
141 | 141 | 'mime' => (string) $attributes['mime'], |
142 | 142 | 'readonly' => (bool) $attributes['readonly'], |
143 | 143 | 'directory' => $node instanceof Collection, |
144 | - 'meta' => function ($node) { |
|
144 | + 'meta' => function($node) { |
|
145 | 145 | return (object) $node->getMetaAttributes(); |
146 | 146 | }, |
147 | - 'size' => function ($node) { |
|
147 | + 'size' => function($node) { |
|
148 | 148 | return $node->getSize(); |
149 | 149 | }, |
150 | - 'path' => function ($node) { |
|
150 | + 'path' => function($node) { |
|
151 | 151 | try { |
152 | 152 | return $node->getPath(); |
153 | 153 | } catch (\Exception $e) { |
154 | 154 | return null; |
155 | 155 | } |
156 | 156 | }, |
157 | - 'parent' => function ($node) { |
|
157 | + 'parent' => function($node) { |
|
158 | 158 | $id = $node->getAttributes()['parent']; |
159 | 159 | |
160 | 160 | if (null === $id) { |
@@ -163,10 +163,10 @@ discard block |
||
163 | 163 | |
164 | 164 | return (string) $id; |
165 | 165 | }, |
166 | - 'access' => function ($node) use ($acl) { |
|
166 | + 'access' => function($node) use ($acl) { |
|
167 | 167 | return $acl->getAclPrivilege($node); |
168 | 168 | }, |
169 | - 'share' => function ($node) { |
|
169 | + 'share' => function($node) { |
|
170 | 170 | if ($node->isShared() || !$node->isSpecial()) { |
171 | 171 | return null; |
172 | 172 | } |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | return null; |
178 | 178 | } |
179 | 179 | }, |
180 | - 'shareowner' => function ($node) use ($server, $fs) { |
|
180 | + 'shareowner' => function($node) use ($server, $fs) { |
|
181 | 181 | if (!$node->isSpecial()) { |
182 | 182 | return null; |
183 | 183 | } |
@@ -223,20 +223,20 @@ discard block |
||
223 | 223 | protected function getTimeAttributes(NodeInterface $node, array $attributes): array |
224 | 224 | { |
225 | 225 | return [ |
226 | - 'created' => function ($node) use ($attributes) { |
|
226 | + 'created' => function($node) use ($attributes) { |
|
227 | 227 | return $this->dateTimeToUnix($attributes['created']); |
228 | 228 | }, |
229 | - 'changed' => function ($node) use ($attributes) { |
|
229 | + 'changed' => function($node) use ($attributes) { |
|
230 | 230 | return $this->dateTimeToUnix($attributes['changed']); |
231 | 231 | }, |
232 | - 'deleted' => function ($node) use ($attributes) { |
|
232 | + 'deleted' => function($node) use ($attributes) { |
|
233 | 233 | if (false === $attributes['deleted']) { |
234 | 234 | return false; |
235 | 235 | } |
236 | 236 | |
237 | 237 | return $this->dateTimeToUnix($attributes['destroy']); |
238 | 238 | }, |
239 | - 'destroy' => function ($node) use ($attributes) { |
|
239 | + 'destroy' => function($node) use ($attributes) { |
|
240 | 240 | if (null === $attributes['destroy']) { |
241 | 241 | return null; |
242 | 242 | } |