@@ -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 @@ |
||
| 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 |
@@ -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 | $result = $node->copyTo($parent, $conflict); |
| 632 | 632 | |
| 633 | 633 | return [ |
@@ -691,7 +691,7 @@ discard block |
||
| 691 | 691 | ); |
| 692 | 692 | } |
| 693 | 693 | |
| 694 | - return $this->bulk($id, $p, function ($node) use ($parent, $conflict) { |
|
| 694 | + return $this->bulk($id, $p, function($node) use ($parent, $conflict) { |
|
| 695 | 695 | $result = $node->setParent($parent, $conflict); |
| 696 | 696 | |
| 697 | 697 | return [ |
@@ -745,7 +745,7 @@ discard block |
||
| 745 | 745 | $at = $this->_verifyAttributes(['destroy' => $at])['destroy']; |
| 746 | 746 | } |
| 747 | 747 | |
| 748 | - return $this->bulk($id, $p, function ($node) use ($force, $ignore_flag, $at) { |
|
| 748 | + return $this->bulk($id, $p, function($node) use ($force, $ignore_flag, $at) { |
|
| 749 | 749 | if (null === $at) { |
| 750 | 750 | $node->delete($force && $node->isDeleted() || $force && $ignore_flag); |
| 751 | 751 | } 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 |