@@ -273,37 +273,37 @@ discard block |
||
273 | 273 | } |
274 | 274 | |
275 | 275 | return $response |
276 | - ->setOutputFormat(null) |
|
277 | - ->setBody(function () use ($node, $offset, $limit) { |
|
278 | - $stream = $node->get(); |
|
279 | - $name = $node->getName(); |
|
280 | - |
|
281 | - if (null === $stream) { |
|
282 | - return; |
|
283 | - } |
|
284 | - |
|
285 | - if (0 !== $offset) { |
|
286 | - if (fseek($stream, $offset) === -1) { |
|
287 | - throw new Exception\Conflict( |
|
276 | + ->setOutputFormat(null) |
|
277 | + ->setBody(function () use ($node, $offset, $limit) { |
|
278 | + $stream = $node->get(); |
|
279 | + $name = $node->getName(); |
|
280 | + |
|
281 | + if (null === $stream) { |
|
282 | + return; |
|
283 | + } |
|
284 | + |
|
285 | + if (0 !== $offset) { |
|
286 | + if (fseek($stream, $offset) === -1) { |
|
287 | + throw new Exception\Conflict( |
|
288 | 288 | 'invalid offset requested', |
289 | 289 | Exception\Conflict::INVALID_OFFSET |
290 | 290 | ); |
291 | - } |
|
292 | - } |
|
293 | - |
|
294 | - $read = 0; |
|
295 | - while (!feof($stream)) { |
|
296 | - if (0 !== $limit && $read + 8192 > $limit) { |
|
297 | - echo fread($stream, $limit - $read); |
|
298 | - exit(); |
|
299 | - } |
|
300 | - |
|
301 | - echo fread($stream, 8192); |
|
302 | - $read += 8192; |
|
303 | - } |
|
304 | - |
|
305 | - exit(); |
|
306 | - }); |
|
291 | + } |
|
292 | + } |
|
293 | + |
|
294 | + $read = 0; |
|
295 | + while (!feof($stream)) { |
|
296 | + if (0 !== $limit && $read + 8192 > $limit) { |
|
297 | + echo fread($stream, $limit - $read); |
|
298 | + exit(); |
|
299 | + } |
|
300 | + |
|
301 | + echo fread($stream, 8192); |
|
302 | + $read += 8192; |
|
303 | + } |
|
304 | + |
|
305 | + exit(); |
|
306 | + }); |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | /** |
@@ -1053,9 +1053,9 @@ discard block |
||
1053 | 1053 | $node->zip($archive); |
1054 | 1054 | } catch (\Exception $e) { |
1055 | 1055 | $this->logger->debug('failed zip node in multi node request ['.$node->getId().']', [ |
1056 | - 'category' => get_class($this), |
|
1057 | - 'exception' => $e, |
|
1058 | - ]); |
|
1056 | + 'category' => get_class($this), |
|
1057 | + 'exception' => $e, |
|
1058 | + ]); |
|
1059 | 1059 | } |
1060 | 1060 | } |
1061 | 1061 |
@@ -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 | } |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | |
275 | 275 | return $response |
276 | 276 | ->setOutputFormat(null) |
277 | - ->setBody(function () use ($node, $offset, $limit) { |
|
277 | + ->setBody(function() use ($node, $offset, $limit) { |
|
278 | 278 | $stream = $node->get(); |
279 | 279 | $name = $node->getName(); |
280 | 280 | |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | return (new Response())->setCode(200)->setBody($result); |
411 | 411 | } |
412 | 412 | |
413 | - return $this->bulk($id, $p, function ($node) use ($attributes) { |
|
413 | + return $this->bulk($id, $p, function($node) use ($attributes) { |
|
414 | 414 | return [ |
415 | 415 | 'code' => 200, |
416 | 416 | 'data' => $this->node_decorator->decorate($node, $attributes), |
@@ -524,9 +524,9 @@ discard block |
||
524 | 524 | public function patch(?string $name = null, ?array $meta = null, ?bool $readonly = null, ?array $filter = null, ?string $id = null, ?string $p = null): Response |
525 | 525 | { |
526 | 526 | $attributes = compact('name', 'meta', 'readonly', 'filter'); |
527 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
527 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
528 | 528 | |
529 | - return $this->bulk($id, $p, function ($node) use ($attributes) { |
|
529 | + return $this->bulk($id, $p, function($node) use ($attributes) { |
|
530 | 530 | foreach ($attributes as $attribute => $value) { |
531 | 531 | switch ($attribute) { |
532 | 532 | case 'name': |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | ); |
609 | 609 | } |
610 | 610 | |
611 | - return $this->bulk($id, $p, function ($node) use ($parent, $conflict) { |
|
611 | + return $this->bulk($id, $p, function($node) use ($parent, $conflict) { |
|
612 | 612 | $result = $node->copyTo($parent, $conflict); |
613 | 613 | |
614 | 614 | return [ |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | ); |
673 | 673 | } |
674 | 674 | |
675 | - return $this->bulk($id, $p, function ($node) use ($parent, $conflict) { |
|
675 | + return $this->bulk($id, $p, function($node) use ($parent, $conflict) { |
|
676 | 676 | $result = $node->setParent($parent, $conflict); |
677 | 677 | |
678 | 678 | return [ |
@@ -726,7 +726,7 @@ discard block |
||
726 | 726 | $at = $this->_verifyAttributes(['destroy' => $at])['destroy']; |
727 | 727 | } |
728 | 728 | |
729 | - return $this->bulk($id, $p, function ($node) use ($force, $ignore_flag, $at) { |
|
729 | + return $this->bulk($id, $p, function($node) use ($force, $ignore_flag, $at) { |
|
730 | 730 | if (null === $at) { |
731 | 731 | $node->delete($force && $node->isDeleted() || $force && $ignore_flag); |
732 | 732 | } else { |