@@ -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 |
@@ -629,7 +629,7 @@ discard block |
||
629 | 629 | return true; |
630 | 630 | } |
631 | 631 | |
632 | - return $this->doRecursiveAction(function ($node) use ($conflict, $recursion) { |
|
632 | + return $this->doRecursiveAction(function($node) use ($conflict, $recursion) { |
|
633 | 633 | $node->undelete($conflict, $recursion, false); |
634 | 634 | }, NodeInterface::DELETED_ONLY); |
635 | 635 | } |
@@ -652,7 +652,7 @@ discard block |
||
652 | 652 | public function getLastModified(): int |
653 | 653 | { |
654 | 654 | if ($this->changed instanceof UTCDateTime) { |
655 | - return (int) $this->changed->toDateTime()->format('U'); |
|
655 | + return (int)$this->changed->toDateTime()->format('U'); |
|
656 | 656 | } |
657 | 657 | |
658 | 658 | return 0; |
@@ -1093,8 +1093,8 @@ discard block |
||
1093 | 1093 | return false; |
1094 | 1094 | } |
1095 | 1095 | |
1096 | - $remove = (array) $remove; |
|
1097 | - $attributes = (array) $attributes; |
|
1096 | + $remove = (array)$remove; |
|
1097 | + $attributes = (array)$attributes; |
|
1098 | 1098 | $this->_hook->run( |
1099 | 1099 | 'preSaveNodeAttributes', |
1100 | 1100 | [$this, &$attributes, &$remove, &$recursion, &$recursion_first] |
@@ -819,7 +819,6 @@ discard block |
||
819 | 819 | /** |
820 | 820 | * Set app attributes. |
821 | 821 | * |
822 | - * @param AppInterface $app |
|
823 | 822 | * @param array $attributes |
824 | 823 | * |
825 | 824 | * @return NodeInterface |
@@ -835,7 +834,6 @@ discard block |
||
835 | 834 | /** |
836 | 835 | * Set app attribute. |
837 | 836 | * |
838 | - * @param AppInterface $app |
|
839 | 837 | * @param string $attribute |
840 | 838 | * @param mixed $value |
841 | 839 | * |
@@ -856,7 +854,6 @@ discard block |
||
856 | 854 | /** |
857 | 855 | * Remove app attribute. |
858 | 856 | * |
859 | - * @param AppInterface $app |
|
860 | 857 | * |
861 | 858 | * @return NodeInterface |
862 | 859 | */ |
@@ -873,7 +870,6 @@ discard block |
||
873 | 870 | /** |
874 | 871 | * Remove app attribute. |
875 | 872 | * |
876 | - * @param AppInterface $app |
|
877 | 873 | * @param string $attribute |
878 | 874 | * |
879 | 875 | * @return NodeInterface |
@@ -891,7 +887,6 @@ discard block |
||
891 | 887 | /** |
892 | 888 | * Get app attribute. |
893 | 889 | * |
894 | - * @param AppInterface $app |
|
895 | 890 | * @param string $attribute |
896 | 891 | * |
897 | 892 | * @return mixed |
@@ -908,7 +903,6 @@ discard block |
||
908 | 903 | /** |
909 | 904 | * Get app attributes. |
910 | 905 | * |
911 | - * @param AppInterface $app |
|
912 | 906 | * |
913 | 907 | * @return array |
914 | 908 | */ |
@@ -947,7 +941,7 @@ discard block |
||
947 | 941 | /** |
948 | 942 | * Get meta attributes as array. |
949 | 943 | * |
950 | - * @param array $attribute Specify attributes to return |
|
944 | + * @param array $attributes Specify attributes to return |
|
951 | 945 | * |
952 | 946 | * @return array |
953 | 947 | */ |
@@ -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 |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | $this->deleted = new UTCDateTime(); |
464 | 464 | |
465 | 465 | if (!$this->isReference()) { |
466 | - $this->doRecursiveAction(function ($node) use ($recursion) { |
|
466 | + $this->doRecursiveAction(function($node) use ($recursion) { |
|
467 | 467 | $node->delete(false, $recursion, false); |
468 | 468 | }, NodeInterface::DELETED_EXCLUDE, false); |
469 | 469 | } |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | |
530 | 530 | $node = $this->_db->storage->findOne($find); |
531 | 531 | |
532 | - return (bool) $node; |
|
532 | + return (bool)$node; |
|
533 | 533 | } |
534 | 534 | |
535 | 535 | /** |
@@ -999,7 +999,7 @@ discard block |
||
999 | 999 | protected function _forceDelete(?string $recursion = null, bool $recursion_first = true): bool |
1000 | 1000 | { |
1001 | 1001 | if (!$this->isReference()) { |
1002 | - $this->doRecursiveAction(function ($node) use ($recursion) { |
|
1002 | + $this->doRecursiveAction(function($node) use ($recursion) { |
|
1003 | 1003 | $node->delete(true, $recursion, false); |
1004 | 1004 | }, NodeInterface::DELETED_INCLUDE, false); |
1005 | 1005 | } |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | /** |
340 | 340 | * Get real id (reference). |
341 | 341 | * |
342 | - * @return ObjectId |
|
342 | + * @return ObjectId|null |
|
343 | 343 | */ |
344 | 344 | public function getRealId(): ?ObjectId |
345 | 345 | { |
@@ -368,7 +368,6 @@ discard block |
||
368 | 368 | /** |
369 | 369 | * Fetch children items of this collection. |
370 | 370 | * |
371 | - * @param string $node |
|
372 | 371 | * @param int $deleted |
373 | 372 | * @param array $filter |
374 | 373 | * @param mixed $name |
@@ -965,7 +964,7 @@ discard block |
||
965 | 964 | * @param string $name |
966 | 965 | * @param string $data |
967 | 966 | * |
968 | - * @return File |
|
967 | + * @return string |
|
969 | 968 | */ |
970 | 969 | public function createFile($name, $data = null): String |
971 | 970 | { |
@@ -16,7 +16,6 @@ |
||
16 | 16 | use Balloon\Filesystem\Acl; |
17 | 17 | use Balloon\Filesystem\Acl\Exception\Forbidden as ForbiddenException; |
18 | 18 | use Balloon\Hook; |
19 | -use Balloon\Server\User; |
|
20 | 19 | use Generator; |
21 | 20 | use MongoDB\BSON\ObjectId; |
22 | 21 | use MongoDB\BSON\Regex; |
@@ -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 |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | return 'd'; |
126 | 126 | } |
127 | 127 | |
128 | - if ((string) $share['owner'] === (string) $user->getId()) { |
|
128 | + if ((string)$share['owner'] === (string)$user->getId()) { |
|
129 | 129 | return 'rw'; |
130 | 130 | } |
131 | 131 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | |
172 | 172 | $groups = $user->getGroups(); |
173 | 173 | foreach ($acl as $rule) { |
174 | - if (self::TYPE_USER === $rule['type'] && $rule['id'] === (string) $user->getId()) { |
|
174 | + if (self::TYPE_USER === $rule['type'] && $rule['id'] === (string)$user->getId()) { |
|
175 | 175 | $priv = $rule['privilege']; |
176 | 176 | } elseif (self::TYPE_GROUP === $rule['type'] && in_array($rule['id'], $groups)) { |
177 | 177 | $priv = $rule['privilege']; |
@@ -734,8 +734,8 @@ |
||
734 | 734 | |
735 | 735 | $ops[] = [ |
736 | 736 | '$sort' => [ |
737 | - 'sum' => -1, |
|
738 | - '_id' => 1, |
|
737 | + 'sum' => -1, |
|
738 | + '_id' => 1, |
|
739 | 739 | ], |
740 | 740 | ]; |
741 | 741 |
@@ -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 |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | } |
289 | 289 | |
290 | 290 | if (true === $string) { |
291 | - $found[] = (string) $share; |
|
291 | + $found[] = (string)$share; |
|
292 | 292 | } else { |
293 | 293 | $found[] = $share; |
294 | 294 | } |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | '$or' => [ |
391 | 391 | ['acl' => [ |
392 | 392 | '$elemMatch' => [ |
393 | - 'id' => (string) $this->_id, |
|
393 | + 'id' => (string)$this->_id, |
|
394 | 394 | 'type' => 'user', |
395 | 395 | ], |
396 | 396 | ]], |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | $list = []; |
408 | 408 | foreach ($item as $child) { |
409 | 409 | $found[] = $child['_id']; |
410 | - $list[(string) $child['_id']] = $child; |
|
410 | + $list[(string)$child['_id']] = $child; |
|
411 | 411 | } |
412 | 412 | |
413 | 413 | if (empty($found)) { |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | |
445 | 445 | $new = array_diff($found, $exists); |
446 | 446 | foreach ($new as $add) { |
447 | - $node = $list[(string) $add]; |
|
447 | + $node = $list[(string)$add]; |
|
448 | 448 | |
449 | 449 | $this->logger->info('found new share ['.$node['_id'].']', [ |
450 | 450 | 'category' => get_class($this), |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | */ |
528 | 528 | public function setHardQuota(int $quota): self |
529 | 529 | { |
530 | - $this->hard_quota = (int) $quota; |
|
530 | + $this->hard_quota = (int)$quota; |
|
531 | 531 | $this->save(['hard_quota']); |
532 | 532 | |
533 | 533 | return $this; |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | */ |
543 | 543 | public function setSoftQuota(int $quota): self |
544 | 544 | { |
545 | - $this->soft_quota = (int) $quota; |
|
545 | + $this->soft_quota = (int)$quota; |
|
546 | 546 | $this->save(['soft_quota']); |
547 | 547 | |
548 | 548 | return $this; |
@@ -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 |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | foreach ($config as $option => $value) { |
58 | 58 | switch ($option) { |
59 | 59 | case 'interval': |
60 | - $this->{$option} = (int) $value; |
|
60 | + $this->{$option} = (int)$value; |
|
61 | 61 | |
62 | 62 | break; |
63 | 63 | default: |
@@ -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 |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | switch ($option) { |
66 | 66 | case 'max_age': |
67 | 67 | case 'interval': |
68 | - $this->{$option} = (int) $value; |
|
68 | + $this->{$option} = (int)$value; |
|
69 | 69 | |
70 | 70 | break; |
71 | 71 | default: |
@@ -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 |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public static function isValidTimestamp(string $timestamp): bool |
88 | 88 | { |
89 | - return ((string) (int) $timestamp === $timestamp) |
|
89 | + return ((string)(int)$timestamp === $timestamp) |
|
90 | 90 | && ($timestamp <= PHP_INT_MAX) |
91 | 91 | && ($timestamp >= ~PHP_INT_MAX); |
92 | 92 | } |
@@ -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 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | foreach ($config as $option => $value) { |
49 | 49 | switch ($option) { |
50 | 50 | case 'db': |
51 | - $this->db = (string) $value; |
|
51 | + $this->db = (string)$value; |
|
52 | 52 | |
53 | 53 | break; |
54 | 54 | default: |
@@ -50,7 +50,7 @@ |
||
50 | 50 | $this->db->storage->updateOne( |
51 | 51 | ['_id' => $object['_id']], |
52 | 52 | [ |
53 | - '$set' => ['filter' => $filter], |
|
53 | + '$set' => ['filter' => $filter], |
|
54 | 54 | ] |
55 | 55 | ); |
56 | 56 | } |
@@ -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 |