@@ -279,50 +279,50 @@ discard block |
||
279 | 279 | } |
280 | 280 | |
281 | 281 | return $response |
282 | - ->setOutputFormat(null) |
|
283 | - ->setBody(function () use ($node, $encode, $offset, $limit) { |
|
284 | - $stream = $node->get(); |
|
285 | - $name = $node->getName(); |
|
286 | - |
|
287 | - if (null === $stream) { |
|
288 | - return; |
|
289 | - } |
|
290 | - |
|
291 | - if (0 !== $offset) { |
|
292 | - if (fseek($stream, $offset) === -1) { |
|
293 | - throw new Exception\Conflict( |
|
282 | + ->setOutputFormat(null) |
|
283 | + ->setBody(function () use ($node, $encode, $offset, $limit) { |
|
284 | + $stream = $node->get(); |
|
285 | + $name = $node->getName(); |
|
286 | + |
|
287 | + if (null === $stream) { |
|
288 | + return; |
|
289 | + } |
|
290 | + |
|
291 | + if (0 !== $offset) { |
|
292 | + if (fseek($stream, $offset) === -1) { |
|
293 | + throw new Exception\Conflict( |
|
294 | 294 | 'invalid offset requested', |
295 | 295 | Exception\Conflict::INVALID_OFFSET |
296 | 296 | ); |
297 | - } |
|
298 | - } |
|
299 | - |
|
300 | - $read = 0; |
|
301 | - if ('base64' === $encode) { |
|
302 | - header('Content-Encoding: base64'); |
|
303 | - while (!feof($stream)) { |
|
304 | - if (0 !== $limit && $read + 8192 > $limit) { |
|
305 | - echo base64_encode(fread($stream, $limit - $read)); |
|
306 | - exit(); |
|
307 | - } |
|
308 | - |
|
309 | - echo base64_encode(fread($stream, 8192)); |
|
310 | - $read += 8192; |
|
311 | - } |
|
312 | - } else { |
|
313 | - while (!feof($stream)) { |
|
314 | - if (0 !== $limit && $read + 8192 > $limit) { |
|
315 | - echo fread($stream, $limit - $read); |
|
316 | - exit(); |
|
317 | - } |
|
318 | - |
|
319 | - echo fread($stream, 8192); |
|
320 | - $read += 8192; |
|
321 | - } |
|
322 | - |
|
323 | - exit(); |
|
324 | - } |
|
325 | - }); |
|
297 | + } |
|
298 | + } |
|
299 | + |
|
300 | + $read = 0; |
|
301 | + if ('base64' === $encode) { |
|
302 | + header('Content-Encoding: base64'); |
|
303 | + while (!feof($stream)) { |
|
304 | + if (0 !== $limit && $read + 8192 > $limit) { |
|
305 | + echo base64_encode(fread($stream, $limit - $read)); |
|
306 | + exit(); |
|
307 | + } |
|
308 | + |
|
309 | + echo base64_encode(fread($stream, 8192)); |
|
310 | + $read += 8192; |
|
311 | + } |
|
312 | + } else { |
|
313 | + while (!feof($stream)) { |
|
314 | + if (0 !== $limit && $read + 8192 > $limit) { |
|
315 | + echo fread($stream, $limit - $read); |
|
316 | + exit(); |
|
317 | + } |
|
318 | + |
|
319 | + echo fread($stream, 8192); |
|
320 | + $read += 8192; |
|
321 | + } |
|
322 | + |
|
323 | + exit(); |
|
324 | + } |
|
325 | + }); |
|
326 | 326 | } |
327 | 327 | |
328 | 328 | /** |
@@ -1073,9 +1073,9 @@ discard block |
||
1073 | 1073 | $node->zip($archive); |
1074 | 1074 | } catch (\Exception $e) { |
1075 | 1075 | $this->logger->debug('failed zip node in multi node request ['.$node->getId().']', [ |
1076 | - 'category' => get_class($this), |
|
1077 | - 'exception' => $e, |
|
1078 | - ]); |
|
1076 | + 'category' => get_class($this), |
|
1077 | + 'exception' => $e, |
|
1078 | + ]); |
|
1079 | 1079 | } |
1080 | 1080 | } |
1081 | 1081 |
@@ -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 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * balloon |
@@ -73,7 +73,6 @@ discard block |
||
73 | 73 | /** |
74 | 74 | * Constructor. |
75 | 75 | * |
76 | - * @param Database $db |
|
77 | 76 | * @param LoggerInterface $logger |
78 | 77 | */ |
79 | 78 | public function __construct(SocketFactory $factory, LoggerInterface $logger, ?Iterable $config = null) |
@@ -131,7 +130,7 @@ discard block |
||
131 | 130 | * |
132 | 131 | * @param File $file |
133 | 132 | * |
134 | - * @return array |
|
133 | + * @return File |
|
135 | 134 | */ |
136 | 135 | public function scan(File $file): array |
137 | 136 | { |
@@ -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 @@ |
||
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 @@ |
||
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 |
@@ -101,14 +101,14 @@ discard block |
||
101 | 101 | return [ |
102 | 102 | 'id' => (string) $slave['_id'], |
103 | 103 | 'format' => (string) $slave['format'], |
104 | - 'master' => function ($slave) use ($fs, $node_decorator) { |
|
104 | + 'master' => function($slave) use ($fs, $node_decorator) { |
|
105 | 105 | try { |
106 | 106 | return $node_decorator->decorate($fs->findNodeById($slave['master']), ['_links', 'id', 'name']); |
107 | 107 | } catch (\Exception $e) { |
108 | 108 | return null; |
109 | 109 | } |
110 | 110 | }, |
111 | - 'slave' => function ($slave) use ($fs, $node_decorator) { |
|
111 | + 'slave' => function($slave) use ($fs, $node_decorator) { |
|
112 | 112 | if (!isset($slave['slave'])) { |
113 | 113 | return null; |
114 | 114 | } |
@@ -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 |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | 'id' => (string) $message['_id'], |
103 | 103 | 'message' => (string) $message['body'], |
104 | 104 | 'subject' => (string) $message['subject'], |
105 | - 'sender' => function ($message) use ($server, $role_decorator) { |
|
105 | + 'sender' => function($message) use ($server, $role_decorator) { |
|
106 | 106 | try { |
107 | 107 | return $role_decorator->decorate($server->getUserById($message['sender']), ['_links', 'id', 'username']); |
108 | 108 | } catch (\Exception $e) { |