Completed
Branch dev (09647c)
by Raffael
11:14
created
src/lib/Filesystem/Node/AbstractNode.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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]
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -7 removed lines patch added patch discarded remove patch
@@ -819,7 +819,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
      */
Please login to merge, or discard this patch.
src/lib/Filesystem/Node/Collection.php 3 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/lib/Filesystem/Acl.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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'];
Please login to merge, or discard this patch.
src/lib/Server/User.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -734,8 +734,8 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/lib/Hook/AutoDestroy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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:
Please login to merge, or discard this patch.
src/lib/Hook/CleanTrash.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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:
Please login to merge, or discard this patch.
src/lib/Helper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/lib/Mime.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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:
Please login to merge, or discard this patch.
src/lib/Migration/Delta/JsonEncodeFilteredCollection.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
Please login to merge, or discard this patch.