Completed
Push — master ( 8b94f4...56b35f )
by Raffael
03:18
created
src/lib/Balloon/Rest/v1/User.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Balloon
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      * @param   string $uname
76 76
      * @return  User
77 77
      */
78
-    public function _getUser(?string $uid=null, ?string $uname=null)
78
+    public function _getUser(?string $uid = null, ?string $uname = null)
79 79
     {
80 80
         if ($uid !== null || $uname !== null) {
81 81
             if ($this->user->isAdmin()) {
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
      * @param  string $uname
139 139
      * @return Response
140 140
      */
141
-    public function getIsAdmin(?string $uid=null, ?string $uname=null): Response
141
+    public function getIsAdmin(?string $uid = null, ?string $uname = null) : Response
142 142
     {
143 143
         $result = $this->_getUser($uid, $uname)->isAdmin();
144 144
         return (new Response())->setCode(200)->setBody($result);
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
      * @param  string $uname
175 175
      * @return Response
176 176
      */
177
-    public function getWhoami(?string $uid=null, ?string $uname=null): Response
177
+    public function getWhoami(?string $uid = null, ?string $uname = null) : Response
178 178
     {
179 179
         $result = $this->_getUser($uid, $uname)->getUsername();
180 180
         return (new Response())->setCode(200)->setBody($result);
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
      * @param  int $limit
213 213
      * @return Response
214 214
      */
215
-    public function getNodeAttributeSummary(?string $uid=null, ?string $uname=null, array $attributes=[], int $limit=25): Response
215
+    public function getNodeAttributeSummary(?string $uid = null, ?string $uname = null, array $attributes = [], int $limit = 25) : Response
216 216
     {
217 217
         $result = $this->_getUser($uid, $uname)->getNodeAttributeSummary($attributes, $limit);
218 218
         return (new Response())->setCode(200)->setBody($result);
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
      * @param  string $uname
252 252
      * @return void
253 253
      */
254
-    public function getGroups(?string $uid=null, ?string $uname=null): Response
254
+    public function getGroups(?string $uid = null, ?string $uname = null) : Response
255 255
     {
256 256
         $result = $this->_getUser($uid, $uname)->getGroups();
257 257
         return (new Response())->setCode(200)->setBody($result);
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
      * @param  string $uname
291 291
      * @return Response
292 292
      */
293
-    public function getShares(?string $uid=null, ?string $uname=null): Response
293
+    public function getShares(?string $uid = null, ?string $uname = null) : Response
294 294
     {
295 295
         $result = $this->_getUser($uid, $uname)->getShares();
296 296
         return (new Response())->setCode(200)->setBody($result);
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
      * @param  string $uname
336 336
      * @return Response
337 337
      */
338
-    public function getQuotaUsage(?string $uid=null, ?string $uname=null): Response
338
+    public function getQuotaUsage(?string $uid = null, ?string $uname = null) : Response
339 339
     {
340 340
         $result = $this->_getUser($uid, $uname)->getQuotaUsage();
341 341
         return (new Response())->setCode(200)->setBody($result);
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
      * @param  string $attributes
374 374
      * @return Response
375 375
      */
376
-    public function getAttributes(?string $uid=null, ?string $uname=null, array $attributes=[]): Response
376
+    public function getAttributes(?string $uid = null, ?string $uname = null, array $attributes = []) : Response
377 377
     {
378 378
         $result = $this->_getUser($uid, $uname)->getAttribute($attributes);
379 379
         return (new Response())->setCode(200)->setBody($result);
Please login to merge, or discard this patch.
src/lib/Balloon/Rest/v1/Collection.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Balloon
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      * @param   string $p
42 42
      * @return  Response
43 43
      */
44
-    public function headChildren(?string $id=null, ?string $p=null): Response
44
+    public function headChildren(?string $id = null, ?string $p = null) : Response
45 45
     {
46 46
         $result   = $this->fs->getNode($id, $p, null, false, true);
47 47
         $children = $result->getSize();
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
      * @return Response
98 98
      */
99 99
     public function getChildren(
100
-        ?string $id=null,
101
-        ?string $p=null,
102
-        int $deleted=0,
103
-        array $filter=[],
104
-        array $attributes=[]): Response
100
+        ?string $id = null,
101
+        ?string $p = null,
102
+        int $deleted = 0,
103
+        array $filter = [],
104
+        array $attributes = []) : Response
105 105
     {
106 106
         $children = [];
107 107
         $nodes = $this->fs->getNode($id, $p, null, false, true)->getChildNodes($deleted, $filter);
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
      * @param  string $p
153 153
      * @return Response
154 154
      */
155
-    public function getShare(?string $id=null, ?string $p=null): Response
155
+    public function getShare(?string $id = null, ?string $p = null) : Response
156 156
     {
157 157
         $result = $this->fs->getNode($id, $p)->getShare();
158 158
         return (new Response())->setCode(200)->setBody($result);
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
      * @param  array $acl
201 201
      * @return Response
202 202
      */
203
-    public function postShare(array $acl, ?string $id=null, ?string $p=null): Response
203
+    public function postShare(array $acl, ?string $id = null, ?string $p = null) : Response
204 204
     {
205 205
         $node    = $this->fs->getNode($id, $p);
206 206
         $result  = $node->share($acl);
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
      * @param  string $p
237 237
      * @return Response
238 238
      */
239
-    public function deleteShare(?string $id=null, ?string $p=null): Response
239
+    public function deleteShare(?string $id = null, ?string $p = null) : Response
240 240
     {
241 241
         $node = $this->fs->getNode($id, $p);
242 242
         $result = $node->unshare();
@@ -291,11 +291,11 @@  discard block
 block discarded – undo
291 291
      * @return Response
292 292
      */
293 293
     public function post(
294
-        ?string $id=null,
295
-        ?string $p=null,
296
-        ?string $name=null,
297
-        array $attributes=[],
298
-        int $conflict=0): Response
294
+        ?string $id = null,
295
+        ?string $p = null,
296
+        ?string $name = null,
297
+        array $attributes = [],
298
+        int $conflict = 0) : Response
299 299
     {
300 300
         if ($p !== null && $name !== null) {
301 301
             throw new Exception\InvalidArgument('p and name can not be used at the same time');
Please login to merge, or discard this patch.
src/lib/Balloon/Rest/v1/Node.php 1 patch
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Balloon
@@ -176,12 +176,12 @@  discard block
 block discarded – undo
176 176
      * @return  INode
177 177
      */
178 178
     protected function _getNode(
179
-        ?string $id=null,
180
-        ?string $path=null,
181
-        ?string $class=null,
182
-        bool $multiple=false,
183
-        bool $allow_root=false,
184
-        int $deleted=2): INode
179
+        ?string $id = null,
180
+        ?string $path = null,
181
+        ?string $class = null,
182
+        bool $multiple = false,
183
+        bool $allow_root = false,
184
+        int $deleted = 2) : INode
185 185
     {
186 186
         if ($class === null) {
187 187
             $class = join('', array_slice(explode('\\', get_class($this)), -1));
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
      * @param   int $deleted
227 227
      * @return  Response
228 228
      */
229
-    public function head(?string $id=null, ?string $p=null, int $deleted=0): Response
229
+    public function head(?string $id = null, ?string $p = null, int $deleted = 0) : Response
230 230
     {
231 231
         try {
232 232
             $result = $this->_getNode($id, $p, null, false, false, $deleted);
@@ -283,12 +283,12 @@  discard block
 block discarded – undo
283 283
      * @return  void
284 284
      */
285 285
     public function postUndelete(
286
-        $id=null,
287
-        ?string $p=null,
288
-        bool $move=false,
289
-        ?string $destid=null,
290
-        ?string $destp=null,
291
-        int $conflict=0): Response
286
+        $id = null,
287
+        ?string $p = null,
288
+        bool $move = false,
289
+        ?string $destid = null,
290
+        ?string $destp = null,
291
+        int $conflict = 0) : Response
292 292
     {
293 293
         if ($move == true) {
294 294
             try {
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
      * @param   array $options
381 381
      * @return  Response
382 382
      */
383
-    public function postShareLink(?string $id=null, ?string $p=null, array $options=[]): Response
383
+    public function postShareLink(?string $id = null, ?string $p = null, array $options = []) : Response
384 384
     {
385 385
         $node = $this->_getNode($id, $p);
386 386
         $options = Helper::filter($options);
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
      * @param   string $p
412 412
      * @return  Response
413 413
      */
414
-    public function deleteShareLink(?string $id=null, ?string $p=null): Response
414
+    public function deleteShareLink(?string $id = null, ?string $p = null) : Response
415 415
     {
416 416
         $node = $this->_getNode($id, $p);
417 417
         
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
      * @param   string $p
455 455
      * @return  Response
456 456
      */
457
-    public function getShareLink(?string $id=null, ?string $p=null): Response
457
+    public function getShareLink(?string $id = null, ?string $p = null) : Response
458 458
     {
459 459
         $result = Helper::escape(
460 460
             $this->_getNode($id, $p)->getShareLink()
@@ -510,13 +510,13 @@  discard block
 block discarded – undo
510 510
      * @return  void
511 511
      */
512 512
     public function get(
513
-        $id=null,
514
-        ?string $p=null,
515
-        int $offset=0,
516
-        int $length=0,
517
-        ?string $encode=null,
518
-        bool $download=false,
519
-        string $name='selected'): void
513
+        $id = null,
514
+        ?string $p = null,
515
+        int $offset = 0,
516
+        int $length = 0,
517
+        ?string $encode = null,
518
+        bool $download = false,
519
+        string $name = 'selected') : void
520 520
     {
521 521
         if (is_array($id)) {
522 522
             $this->_combine($id, $p, $name);
@@ -533,13 +533,13 @@  discard block
 block discarded – undo
533 533
         }
534 534
 
535 535
         if ($download == true) {
536
-            header('Content-Disposition: attachment; filename*=UTF-8\'\'' .rawurlencode($name));
536
+            header('Content-Disposition: attachment; filename*=UTF-8\'\''.rawurlencode($name));
537 537
             header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
538 538
             header('Content-Type: application/octet-stream');
539 539
             header('Content-Length: '.$node->getSize());
540 540
             header('Content-Transfer-Encoding: binary');
541 541
         } else {
542
-            header('Content-Disposition: inline; filename*=UTF-8\'\'' .rawurlencode($name));
542
+            header('Content-Disposition: inline; filename*=UTF-8\'\''.rawurlencode($name));
543 543
         }
544 544
 
545 545
         if ($stream === null) {
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
      * @param   string $p
609 609
      * @return  Response
610 610
      */
611
-    public function postReadonly($id=null, ?string $p=null, bool $readonly=true): Response
611
+    public function postReadonly($id = null, ?string $p = null, bool $readonly = true) : Response
612 612
     {
613 613
         if (is_array($id)) {
614 614
             $failures = [];
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
      * @param   string $name
652 652
      * @return  void
653 653
      */
654
-    protected function _combine($id=null, ?string $path=null, string $name='selected'): void
654
+    protected function _combine($id = null, ?string $path = null, string $name = 'selected') : void
655 655
     {
656 656
         $temp = $this->config->dir->temp.DIRECTORY_SEPARATOR.'zip';
657 657
         if (!file_exists($temp)) {
@@ -776,10 +776,10 @@  discard block
 block discarded – undo
776 776
      * @param  array $attributes
777 777
      * @return Response
778 778
      */
779
-    public function getAttributes($id=null, ?string $p=null, array $attributes=[]): Response
779
+    public function getAttributes($id = null, ?string $p = null, array $attributes = []) : Response
780 780
     {
781 781
         if (is_array($id)) {
782
-            $nodes    = [];
782
+            $nodes = [];
783 783
             foreach ($this->fs->findNodes($id) as $node) {
784 784
                 $nodes[] = Helper::escape($node->getAttribute($attributes));
785 785
             }
@@ -905,7 +905,7 @@  discard block
 block discarded – undo
905 905
      * @param  array $attributes
906 906
      * @return Response
907 907
      */
908
-    public function getParent(?string $id=null, ?string $p=null, array $attributes=[]): Response
908
+    public function getParent(?string $id = null, ?string $p = null, array $attributes = []) : Response
909 909
     {
910 910
         $result = Helper::escape(
911 911
             $this->_getNode($id, $p)
@@ -987,7 +987,7 @@  discard block
 block discarded – undo
987 987
      * @param  array $attributes
988 988
      * @return Response
989 989
      */
990
-    public function getParents(?string $id=null, ?string $p=null, array $attributes=[], bool $self=false): Response
990
+    public function getParents(?string $id = null, ?string $p = null, array $attributes = [], bool $self = false) : Response
991 991
     {
992 992
         $request = $this->_getNode($id, $p);
993 993
         $parents = $request->getParents();
@@ -1035,7 +1035,7 @@  discard block
 block discarded – undo
1035 1035
      * @param   string $p
1036 1036
      * @return  Response
1037 1037
      */
1038
-    public function postMetaAttributes(?string $id=null, ?string $p=null): Response
1038
+    public function postMetaAttributes(?string $id = null, ?string $p = null) : Response
1039 1039
     {
1040 1040
         $this->_getNode($id, $p)->setMetaAttribute(Helper::filter($_POST));
1041 1041
         return (new Response())->setCode(204);
@@ -1068,7 +1068,7 @@  discard block
 block discarded – undo
1068 1068
      * @param   string $name
1069 1069
      * @return  Response
1070 1070
      */
1071
-    public function postName(string $name, ?string $id=null, ?string $p=null): Response
1071
+    public function postName(string $name, ?string $id = null, ?string $p = null) : Response
1072 1072
     {
1073 1073
         $this->_getNode($id, $p)->setName($name);
1074 1074
         return (new Response())->setCode(204);
@@ -1106,11 +1106,11 @@  discard block
 block discarded – undo
1106 1106
      * @return  Response
1107 1107
      */
1108 1108
     public function postClone(
1109
-        $id=null,
1110
-        ?string $p=null,
1111
-        ?string $destid=null,
1112
-        ?string $destp=null,
1113
-        int $conflict=0): Response
1109
+        $id = null,
1110
+        ?string $p = null,
1111
+        ?string $destid = null,
1112
+        ?string $destp = null,
1113
+        int $conflict = 0) : Response
1114 1114
     {
1115 1115
         try {
1116 1116
             $parent = $this->_getNode($destid, $destp, 'Collection', false, true);
@@ -1192,11 +1192,11 @@  discard block
 block discarded – undo
1192 1192
      * @return  Response
1193 1193
      */
1194 1194
     public function postMove(
1195
-        $id=null,
1196
-        ?string $p=null,
1197
-        ?string $destid=null,
1198
-        ?string $destp=null,
1199
-        int $conflict=0): Response
1195
+        $id = null,
1196
+        ?string $p = null,
1197
+        ?string $destid = null,
1198
+        ?string $destp = null,
1199
+        int $conflict = 0) : Response
1200 1200
     {
1201 1201
         try {
1202 1202
             $parent = $this->_getNode($destid, $destp, 'Collection', false, true);
@@ -1276,11 +1276,11 @@  discard block
 block discarded – undo
1276 1276
      * @return  Response
1277 1277
      */
1278 1278
     public function delete(
1279
-        $id=null,
1280
-        ?string $p=null,
1281
-        bool $force=false,
1282
-        bool $ignore_flag=false,
1283
-        ?string $at=null): Response
1279
+        $id = null,
1280
+        ?string $p = null,
1281
+        bool $force = false,
1282
+        bool $ignore_flag = false,
1283
+        ?string $at = null) : Response
1284 1284
     {
1285 1285
         $failures = [];
1286 1286
             
@@ -1373,7 +1373,7 @@  discard block
 block discarded – undo
1373 1373
      * @param  array $attributes
1374 1374
      * @return Response
1375 1375
      */
1376
-    public function getQuery(int $deleted=0, array $filter=[], array $attributes=[]): Response
1376
+    public function getQuery(int $deleted = 0, array $filter = [], array $attributes = []): Response
1377 1377
     {
1378 1378
         $children = [];
1379 1379
         $nodes = $this->fs->findNodesWithCustomFilterUser($deleted, $filter);
@@ -1414,7 +1414,7 @@  discard block
 block discarded – undo
1414 1414
      * @param  array $attributes
1415 1415
      * @return Response
1416 1416
      */
1417
-    public function getTrash(array $attributes=[]): Response
1417
+    public function getTrash(array $attributes = []): Response
1418 1418
     {
1419 1419
         $children = [];
1420 1420
         $nodes = $this->fs->findNodesWithCustomFilterUser(INode::DELETED_ONLY, ['deleted' => ['$type' => 9]]);
@@ -1489,7 +1489,7 @@  discard block
 block discarded – undo
1489 1489
      * @param  int $deleted
1490 1490
      * @return Response
1491 1491
      */
1492
-    public function getSearch(array $query, array $attributes=[], int $deleted=0): Response
1492
+    public function getSearch(array $query, array $attributes = [], int $deleted = 0): Response
1493 1493
     {
1494 1494
         $children = [];
1495 1495
         $nodes = $this->fs->search($query, $deleted);
@@ -1599,11 +1599,11 @@  discard block
 block discarded – undo
1599 1599
      * @return  Response
1600 1600
      */
1601 1601
     public function getDelta(
1602
-        ?string $id=null,
1603
-        ?string $p=null,
1604
-        ?string $cursor=null,
1605
-        int $limit=250,
1606
-        array $attributes=[]): Response
1602
+        ?string $id = null,
1603
+        ?string $p = null,
1604
+        ?string $cursor = null,
1605
+        int $limit = 250,
1606
+        array $attributes = []) : Response
1607 1607
     {
1608 1608
         if ($id !== null || $p !== null) {
1609 1609
             $node = $this->_getNode($id, $p);
@@ -1611,7 +1611,7 @@  discard block
 block discarded – undo
1611 1611
             $node = null;
1612 1612
         }
1613 1613
         
1614
-        $result= $this->fs->getDelta()->getDeltaFeed($cursor, $limit, $attributes, $node);
1614
+        $result = $this->fs->getDelta()->getDeltaFeed($cursor, $limit, $attributes, $node);
1615 1615
 
1616 1616
         return (new Response())->setCode(200)->setBody($result);
1617 1617
     }
@@ -1719,7 +1719,7 @@  discard block
 block discarded – undo
1719 1719
      * @param  int $limit
1720 1720
      * @return Response
1721 1721
      */
1722
-    public function getEventLog(?string $id=null, ?string $p=null, int $skip=0, int $limit=100): Response
1722
+    public function getEventLog(?string $id = null, ?string $p = null, int $skip = 0, int $limit = 100) : Response
1723 1723
     {
1724 1724
         if ($id !== null || $p !== null) {
1725 1725
             $node = $this->_getNode($id, $p);
@@ -1759,7 +1759,7 @@  discard block
 block discarded – undo
1759 1759
      * @param   string $p
1760 1760
      * @return  Response
1761 1761
      */
1762
-    public function getLastCursor(?string $id=null, ?string $p=null): Response
1762
+    public function getLastCursor(?string $id = null, ?string $p = null) : Response
1763 1763
     {
1764 1764
         if ($id !== null || $p !== null) {
1765 1765
             $node = $this->_getNode($id, $p);
@@ -1767,7 +1767,7 @@  discard block
 block discarded – undo
1767 1767
             $node = null;
1768 1768
         }
1769 1769
 
1770
-        $result= $this->fs->getDelta()->getLastCursor();
1770
+        $result = $this->fs->getDelta()->getLastCursor();
1771 1771
         return (new Response())->setCode(200)->setBody($result);
1772 1772
     }
1773 1773
 }
Please login to merge, or discard this patch.
src/lib/Balloon/Filesystem/Node/Collection.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Balloon
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      * @param  bool $force
74 74
      * @return void
75 75
      */
76
-    public function __construct(?BSONDocument $node, Filesystem $fs, bool $force=false)
76
+    public function __construct(?BSONDocument $node, Filesystem $fs, bool $force = false)
77 77
     {
78 78
         parent::__construct($node, $fs);
79 79
         
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
             $this->_id = null;
82 82
 
83 83
             if ($this->_user instanceof User) {
84
-                $this->owner  = $this->_user->getId();
84
+                $this->owner = $this->_user->getId();
85 85
             }
86 86
         }
87 87
             
88
-        if($force === false) {
88
+        if ($force === false) {
89 89
             $this->_verifyAccess();
90 90
         }
91 91
     }
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
      * @param  bool $recursion_first
101 101
      * @return INode
102 102
      */
103
-    public function copyTo(Collection $parent, int $conflict=INode::CONFLICT_NOACTION, ?string $recursion=null, bool $recursion_first=true): INode
103
+    public function copyTo(Collection $parent, int $conflict = INode::CONFLICT_NOACTION, ?string $recursion = null, bool $recursion_first = true) : INode
104 104
     {
105 105
         if ($recursion === null) {
106 106
             $recursion_first = true;
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
      * @param  array|string $attribute
200 200
      * @return array|string
201 201
      */
202
-    public function getAttribute($attribute=[])
202
+    public function getAttribute($attribute = [])
203 203
     {
204 204
         if (empty($attribute)) {
205 205
             $attribute = [
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
      * @param   array $filter
246 246
      * @return  Generator
247 247
      */
248
-    public function getChildNodes(int $deleted=INode::DELETED_EXCLUDE, array $filter=[]): Generator
248
+    public function getChildNodes(int $deleted = INode::DELETED_EXCLUDE, array $filter = []): Generator
249 249
     {
250 250
         if ($this->_user instanceof User) {
251 251
             $this->_user->findNewShares();
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
      * @param   array $filter
317 317
      * @return  Generator
318 318
      */
319
-    public function getChildren(int $deleted=INode::DELETED_EXCLUDE, array $filter=[]): array
319
+    public function getChildren(int $deleted = INode::DELETED_EXCLUDE, array $filter = []): array
320 320
     {
321 321
         return iterator_to_array($this->getChildNodes($deleted, $filter));
322 322
     }
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
      * @param  array $filter
388 388
      * @return INode
389 389
      */
390
-    public function getChild($node, int $deleted=INode::DELETED_EXCLUDE, array $filter=[]): INode
390
+    public function getChild($node, int $deleted = INode::DELETED_EXCLUDE, array $filter = []): INode
391 391
     {
392 392
         //if $node is string load the object from the backend based on the current parent (the name
393 393
         //is unique per depth, so we can load the object)
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
      * @param   int $deleted
457 457
      * @return  bool
458 458
      */
459
-    protected function doRecursiveAction(string $method, array $params=[], int $deleted=INode::DELETED_EXCLUDE): bool
459
+    protected function doRecursiveAction(string $method, array $params = [], int $deleted = INode::DELETED_EXCLUDE): bool
460 460
     {
461 461
         if (!is_callable([$this, $method])) {
462 462
             throw new Exception("method $method is not callable in ".__CLASS__);
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
      * @param   bool $recursion_first
484 484
      * @return  bool
485 485
      */
486
-    public function delete(bool $force=false, ?string $recursion=null, bool $recursion_first=true): bool
486
+    public function delete(bool $force = false, ?string $recursion = null, bool $recursion_first = true) : bool
487 487
     {
488 488
         if (!$this->isAllowed('w') && !$this->isReference()) {
489 489
             throw new Exception\Forbidden('not allowed to delete node '.$this->name,
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
      * @param   bool $recursion_first
547 547
      * @return  bool
548 548
      */
549
-    protected function _forceDelete(?string $recursion=null, bool $recursion_first=true): bool
549
+    protected function _forceDelete(?string $recursion = null, bool $recursion_first = true) : bool
550 550
     {
551 551
         if (!$this->isReference()) {
552 552
             $this->doRecursiveAction('delete', [
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
      * @param   array $filter
599 599
      * @return  bool
600 600
      */
601
-    public function childExists($name, $deleted=INode::DELETED_EXCLUDE, array $filter=[]): bool
601
+    public function childExists($name, $deleted = INode::DELETED_EXCLUDE, array $filter = []): bool
602 602
     {
603 603
         $find = [
604 604
             'parent'  => $this->getRealId(),
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
         }
733 733
 
734 734
         $this->shared = false;
735
-        $this->acl   = null;
735
+        $this->acl = null;
736 736
         $action = [
737 737
             '$unset' => [
738 738
                 'shared' => $this->_id
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
      * @param   arary $files
793 793
      * @return  array
794 794
      */
795
-    public function getChildrenRecursive(?ObjectId $id=null, ?array &$shares=[], ?array &$files=[]): array
795
+    public function getChildrenRecursive(?ObjectId $id = null, ? array &$shares = [], ? array &$files = []) : array
796 796
     {
797 797
         $list = [];
798 798
         $result = $this->_db->storage->find([
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
      * @param   bool $clone
837 837
      * @return  Collection
838 838
      */
839
-    public function addDirectory($name, array $attributes=[], int $conflict=INode::CONFLICT_NOACTION, bool $clone=false): Collection
839
+    public function addDirectory($name, array $attributes = [], int $conflict = INode::CONFLICT_NOACTION, bool $clone = false): Collection
840 840
     {
841 841
         if (!$this->isAllowed('w')) {
842 842
             throw new Exception\Forbidden('not allowed to create new node here',
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
                 'shared'    => ($this->shared === true ? $this->getRealId() : $this->shared)
884 884
             ];
885 885
 
886
-            $save  = array_merge($meta, $attributes);
886
+            $save = array_merge($meta, $attributes);
887 887
 
888 888
             $result = $this->_db->storage->insertOne($save);
889 889
             $save['_id'] = $result->getInsertedId();
@@ -916,7 +916,7 @@  discard block
 block discarded – undo
916 916
      * @param   bool $clone
917 917
      * @return  File
918 918
      */
919
-    public function addFile($name, $data=null, array $attributes=[], int $conflict=INode::CONFLICT_NOACTION, bool $clone=false): File
919
+    public function addFile($name, $data = null, array $attributes = [], int $conflict = INode::CONFLICT_NOACTION, bool $clone = false): File
920 920
     {
921 921
         if (!$this->isAllowed('w')) {
922 922
             throw new Exception\Forbidden('not allowed to create new node here',
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
                 'shared'    => ($this->shared === true ? $this->getRealId() : $this->shared),
967 967
             ];
968 968
 
969
-            $save  = array_merge($meta, $attributes);
969
+            $save = array_merge($meta, $attributes);
970 970
 
971 971
             $result = $this->_db->storage->insertOne($save);
972 972
             $save['_id'] = $result->getInsertedId();
@@ -1016,7 +1016,7 @@  discard block
 block discarded – undo
1016 1016
      * @param   string $data
1017 1017
      * @return  File
1018 1018
      */
1019
-    public function createFile($name, $data=null): String
1019
+    public function createFile($name, $data = null): String
1020 1020
     {
1021 1021
         return $this->addFile($name, $data)->getETag();
1022 1022
     }
Please login to merge, or discard this patch.
src/lib/Balloon/Filesystem/Node/File.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Balloon
@@ -47,14 +47,14 @@  discard block
 block discarded – undo
47 47
      * @param array
48 48
      **/
49 49
     protected $temp_files = [
50
-        '/^\._(.*)$/',     // OS/X resource forks
51
-        '/^.DS_Store$/',   // OS/X custom folder settings
50
+        '/^\._(.*)$/', // OS/X resource forks
51
+        '/^.DS_Store$/', // OS/X custom folder settings
52 52
         '/^desktop.ini$/', // Windows custom folder settings
53
-        '/^Thumbs.db$/',   // Windows thumbnail cache
54
-        '/^.(.*).swpx$/',  // ViM temporary files
55
-        '/^.(.*).swx$/',   // ViM temporary files
56
-        '/^.(.*).swp$/',   // ViM temporary files
57
-        '/^\.dat(.*)$/',   // Smultron seems to create these
53
+        '/^Thumbs.db$/', // Windows thumbnail cache
54
+        '/^.(.*).swpx$/', // ViM temporary files
55
+        '/^.(.*).swx$/', // ViM temporary files
56
+        '/^.(.*).swp$/', // ViM temporary files
57
+        '/^\.dat(.*)$/', // Smultron seems to create these
58 58
         '/^~lock.(.*)#$/', // Windows 7 lockfiles
59 59
     ];
60 60
 
@@ -123,11 +123,11 @@  discard block
 block discarded – undo
123 123
      * @param   bool $force
124 124
      * @return  void
125 125
      */
126
-    public function __construct(BSONDocument $node, Filesystem $fs, bool $force=false)
126
+    public function __construct(BSONDocument $node, Filesystem $fs, bool $force = false)
127 127
     {
128 128
         parent::__construct($node, $fs);
129 129
 
130
-        if($force === false) {
130
+        if ($force === false) {
131 131
             $this->_verifyAccess();
132 132
         }
133 133
     }
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
      * @param  bool $recursion_first
164 164
      * @return INode
165 165
      */
166
-    public function copyTo(Collection $parent, int $conflict=INode::CONFLICT_NOACTION, ?string $recursion=null, bool $recursion_first=true): INode
166
+    public function copyTo(Collection $parent, int $conflict = INode::CONFLICT_NOACTION, ?string $recursion = null, bool $recursion_first = true) : INode
167 167
     {
168 168
         $this->_pluginmgr->run('preCopyFile',
169 169
             [$this, $parent, &$conflict, &$recursion, &$recursion_first]
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
      * @param   bool $recursion_first
321 321
      * @return  bool
322 322
      */
323
-    public function delete(bool $force=false, ?string $recursion=null, bool $recursion_first=true): bool
323
+    public function delete(bool $force = false, ?string $recursion = null, bool $recursion_first = true) : bool
324 324
     {
325 325
         if (!$this->isAllowed('w')) {
326 326
             throw new Exception\Forbidden('not allowed to delete node '.$this->name,
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
         }
344 344
 
345 345
         $ts = new UTCDateTime();
346
-        $this->deleted  = $ts;
346
+        $this->deleted = $ts;
347 347
         $this->increaseVersion();
348 348
         
349 349
         $this->history[] = [
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
                     return true;
439 439
                 }
440 440
 
441
-                $ref  = $file['metadata']['ref'];
441
+                $ref = $file['metadata']['ref'];
442 442
                 
443 443
                 $found = false;
444 444
                 foreach ($ref as $key => $node) {
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
      * @param  string|array $attribute
578 578
      * @return array|string
579 579
      */
580
-    public function getAttribute($attribute=[])
580
+    public function getAttribute($attribute = [])
581 581
     {
582 582
         if (empty($attribute)) {
583 583
             $attribute = [
@@ -896,8 +896,8 @@  discard block
 block discarded – undo
896 896
     {
897 897
         assert(strlen($data) == 16);
898 898
 
899
-        $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100
900
-        $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10
899
+        $data[6] = chr(ord($data[6])&0x0f|0x40); // set version to 0100
900
+        $data[8] = chr(ord($data[8])&0x3f|0x80); // set bits 6-7 to 10
901 901
 
902 902
         return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
903 903
     }
@@ -921,7 +921,7 @@  discard block
 block discarded – undo
921 921
      * @param   array $attributes
922 922
      * @return  int
923 923
      */
924
-    public function put($file, bool $new=false, array $attributes=[]): int
924
+    public function put($file, bool $new = false, array $attributes = []): int
925 925
     {
926 926
         $this->_logger->debug('PUT new content data for ['.$this->_id.']', [
927 927
             'category' => get_class($this),
@@ -972,7 +972,7 @@  discard block
 block discarded – undo
972 972
                 );
973 973
             }
974 974
 
975
-            $file  = $tmp_file;
975
+            $file = $tmp_file;
976 976
         }
977 977
         
978 978
        
@@ -1040,10 +1040,10 @@  discard block
 block discarded – undo
1040 1040
             $this->mime = $attributes['mime'];
1041 1041
         } elseif ($file !== null) {
1042 1042
             $finfo = finfo_open(FILEINFO_MIME_TYPE);
1043
-            $this->mime  = finfo_file($finfo, $file);
1043
+            $this->mime = finfo_file($finfo, $file);
1044 1044
             if ($this->mime == 'application/zip' || $this->mime == 'application/vnd.ms-office') {
1045 1045
                 $mime = $this->getMimeTypeFromExtension($this->name);
1046
-                if($mime !== null) {
1046
+                if ($mime !== null) {
1047 1047
                     $this->mime = $mime;
1048 1048
                 }
1049 1049
             }
@@ -1136,7 +1136,7 @@  discard block
 block discarded – undo
1136 1136
      * @param  string $db mimetypes
1137 1137
      * @return string
1138 1138
      */
1139
-    public function getMimeTypeFromExtension(string $filename, string $db='/etc/mime.types'): ?string
1139
+    public function getMimeTypeFromExtension(string $filename, string $db = '/etc/mime.types'): ?string
1140 1140
     {
1141 1141
         if (!is_readable($db)) {
1142 1142
             throw new Exception('mime database '.$db.' was not found or is not readable');
@@ -1153,7 +1153,7 @@  discard block
 block discarded – undo
1153 1153
             if (substr($line, 0, 1) == '#') {
1154 1154
                 continue;
1155 1155
             } // skip comments
1156
-            $line = rtrim($line) . " ";
1156
+            $line = rtrim($line)." ";
1157 1157
             if (!preg_match($regex, $line, $matches)) {
1158 1158
                 continue;
1159 1159
             } // no match to the extension
Please login to merge, or discard this patch.
src/lib/Balloon/Rest/v1/File.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Balloon
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      * @param  string $encode
56 56
      * @return void
57 57
      */
58
-    public function getPreview(?string $id=null, ?string $p=null, ?string $encode=null): void
58
+    public function getPreview(?string $id = null, ?string $p = null, ?string $encode = null) : void
59 59
     {
60 60
         $node = $this->_getNode($id, $p);
61 61
         $data = $node->getPreview();
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      * @param  string $p
129 129
      * @return Response
130 130
      */
131
-    public function getHistory(?string $id=null, ?string $p=null): Response
131
+    public function getHistory(?string $id = null, ?string $p = null) : Response
132 132
     {
133 133
         $result = Helper::escape(
134 134
             $this->_getNode($id, $p)->getHistory()
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
      * @param   string $version
162 162
      * @return  Response
163 163
      */
164
-    public function postRestore(int $version, ?string $id=null, ?string $p=null): Response
164
+    public function postRestore(int $version, ?string $id = null, ?string $p = null) : Response
165 165
     {
166 166
         $result = $this->_getNode($id, $p)->restore($version);
167 167
         return (new Response())->setCode(204);
@@ -297,15 +297,15 @@  discard block
 block discarded – undo
297 297
      */
298 298
     public function putChunk(
299 299
         string $chunkgroup,
300
-        ?string $id=null,
301
-        ?string $p=null,
302
-        ?string $collection=null,
303
-        ?string $name=null,
304
-        int $index=1,
305
-        int $chunks=0,
306
-        int $size=0,
307
-        array $attributes=[],
308
-        int $conflict=0)
300
+        ?string $id = null,
301
+        ?string $p = null,
302
+        ?string $collection = null,
303
+        ?string $name = null,
304
+        int $index = 1,
305
+        int $chunks = 0,
306
+        int $size = 0,
307
+        array $attributes = [],
308
+        int $conflict = 0)
309 309
     {
310 310
         ini_set('auto_detect_line_endings', '1');
311 311
         $input_handler = fopen('php://input', 'rb');
@@ -464,12 +464,12 @@  discard block
 block discarded – undo
464 464
      * @return Response
465 465
      */
466 466
     public function put(
467
-        ?string $id=null,
468
-        ?string $p=null,
469
-        ?string $collection=null,
470
-        ?string $name=null,
471
-        array $attributes=[],
472
-        int $conflict=0): Response
467
+        ?string $id = null,
468
+        ?string $p = null,
469
+        ?string $collection = null,
470
+        ?string $name = null,
471
+        array $attributes = [],
472
+        int $conflict = 0) : Response
473 473
     {
474 474
         $attributes = $this->_verifyAttributes($attributes);
475 475
 
@@ -493,12 +493,12 @@  discard block
 block discarded – undo
493 493
      */
494 494
     protected function _put(
495 495
         $content,
496
-        ?string $id=null,
497
-        ?string $p=null,
498
-        ?string $collection=null,
499
-        ?string $name=null,
500
-        array $attributes=[],
501
-        int $conflict=0): Response
496
+        ?string $id = null,
497
+        ?string $p = null,
498
+        ?string $collection = null,
499
+        ?string $name = null,
500
+        array $attributes = [],
501
+        int $conflict = 0) : Response
502 502
     {
503 503
         if ($id === null && $p === null && $name === null) {
504 504
             throw new Exception\InvalidArgument('neither id, p nor name was set');
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
                 $result = $node->put($content, false, $attributes);
519 519
                 return (new Response())->setCode(200)->setBody($result);
520 520
             } elseif ($p === null && $id === null && $name !== null) {
521
-                $collection =  $this->_getNode($collection, null, 'Collection', false, true);
521
+                $collection = $this->_getNode($collection, null, 'Collection', false, true);
522 522
 
523 523
                 if ($collection->childExists($name)) {
524 524
                     $child = $collection->getChild($name);
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
                     return (new Response())->setCode(201)->setBody($result);
535 535
                 }
536 536
             }
537
-        } catch(Exception\Forbidden $e) {
537
+        } catch (Exception\Forbidden $e) {
538 538
             throw new Exception\Conflict('a node called '.$name.' does already exists in this collection',
539 539
                 Exception\Conflict::NODE_WITH_SAME_NAME_ALREADY_EXISTS
540 540
             );
Please login to merge, or discard this patch.
src/lib/Balloon/Filesystem/Node/Node.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Balloon
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
      * @param  bool $force
223 223
      * @return void
224 224
      */
225
-    public function __construct(?BSONDocument $node, Filesystem $fs, bool $force=false)
225
+    public function __construct(?BSONDocument $node, Filesystem $fs, bool $force = false)
226 226
     {
227 227
         $this->_fs         = $fs;
228 228
         $this->_db         = $fs->getDatabase();
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
      *
271 271
      * @return mixed
272 272
      */
273
-    public function __call(string $attribute, array $params=[])
273
+    public function __call(string $attribute, array $params = [])
274 274
     {
275 275
         $prefix = 'get';
276 276
         $attr = strtolower(substr($attribute, 3));
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
      * @param  int $conflict
316 316
      * @return INode
317 317
      */
318
-    public function setParent(Collection $parent, int $conflict=INode::CONFLICT_NOACTION): INode
318
+    public function setParent(Collection $parent, int $conflict = INode::CONFLICT_NOACTION): INode
319 319
     {
320 320
         if ($this->parent === $parent->getId()) {
321 321
             throw new Exception\Conflict('source node '.$this->name.' is already in the requested parent folder',
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
      * @param   bool $recursion_first
391 391
      * @return  INode
392 392
      */
393
-    abstract public function copyTo(Collection $parent, int $conflict=INode::CONFLICT_NOACTION, ?string $recursion=null, bool $recursion_first=true): INode;
393
+    abstract public function copyTo(Collection $parent, int $conflict = INode::CONFLICT_NOACTION, ?string $recursion = null, bool $recursion_first = true) : INode;
394 394
 
395 395
 
396 396
     /**
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
      * @param   bool $reference
400 400
      * @return  ObjectId
401 401
      */
402
-    public function getShareId(bool $reference=false): ?ObjectId
402
+    public function getShareId(bool $reference = false): ?ObjectId
403 403
     {
404 404
         if ($this->isReference() && $reference === true) {
405 405
             return $this->_id;
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
      * @param   string $privilege
596 596
      * @return  bool
597 597
      */
598
-    public function isAllowed(string $privilege='r'): bool
598
+    public function isAllowed(string $privilege = 'r'): bool
599 599
     {
600 600
         $acl   = null;
601 601
         $share = null;
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
             $clean[] = 'meta';
790 790
         }
791 791
         
792
-        $attribute  = $clean;
792
+        $attribute = $clean;
793 793
 
794 794
         try {
795 795
             $sharenode  = $this->getShareNode();
@@ -919,7 +919,7 @@  discard block
 block discarded – undo
919 919
      * @param   string $name
920 920
      * @return  string
921 921
      */
922
-    protected function _getDuplicateName(?string $name=null): string
922
+    protected function _getDuplicateName(?string $name = null) : string
923 923
     {
924 924
         if ($name === null) {
925 925
             $name = $this->name;
@@ -928,7 +928,7 @@  discard block
 block discarded – undo
928 928
         if ($this instanceof Collection) {
929 929
             return $name.' ('.substr(uniqid('', true), -4).')';
930 930
         } else {
931
-            $ext  = substr(strrchr($name, '.'), 1);
931
+            $ext = substr(strrchr($name, '.'), 1);
932 932
 
933 933
             if ($ext === false) {
934 934
                 return $name.' ('.substr(uniqid('', true), -4).')';
@@ -948,7 +948,7 @@  discard block
 block discarded – undo
948 948
      * @param   bool $recursion_first
949 949
      * @return  bool
950 950
      */
951
-    public function undelete(int $conflict=INode::CONFLICT_NOACTION, ?string $recursion=null, bool $recursion_first=true): bool
951
+    public function undelete(int $conflict = INode::CONFLICT_NOACTION, ?string $recursion = null, bool $recursion_first = true) : bool
952 952
     {
953 953
         if (!$this->isAllowed('w')) {
954 954
             throw new Exception\Forbidden('not allowed to restore node '.$this->name,
@@ -988,7 +988,7 @@  discard block
 block discarded – undo
988 988
             $recursion_first = false;
989 989
         }
990 990
 
991
-        $this->deleted  = false;
991
+        $this->deleted = false;
992 992
         
993 993
         if ($this instanceof File) {
994 994
             $current = $this->version;
@@ -1016,7 +1016,7 @@  discard block
 block discarded – undo
1016 1016
                 'deleted',
1017 1017
             ], [], $recursion, $recursion_first);
1018 1018
 
1019
-            if($this->isReference()) {
1019
+            if ($this->isReference()) {
1020 1020
                 return true;
1021 1021
             }            
1022 1022
 
@@ -1146,7 +1146,7 @@  discard block
 block discarded – undo
1146 1146
      *
1147 1147
      * @return ObjectId|string
1148 1148
      */
1149
-    public function getId(bool $string=false)
1149
+    public function getId(bool $string = false)
1150 1150
     {
1151 1151
         if ($string === true) {
1152 1152
             return (string)$this->_id;
@@ -1196,7 +1196,7 @@  discard block
 block discarded – undo
1196 1196
      * @param   array $parents
1197 1197
      * @return  array
1198 1198
      */
1199
-    public function getParents(?INode $node=null, array $parents=[]): array
1199
+    public function getParents(?INode $node = null, array $parents = []) : array
1200 1200
     {
1201 1201
         if ($node === null) {
1202 1202
             $node = $this;
@@ -1263,7 +1263,7 @@  discard block
 block discarded – undo
1263 1263
      * @param   int $depth
1264 1264
      * @return  bool
1265 1265
      */
1266
-    public function zip(ZipStream $archive, bool $self=true, ?INode $parent=null, string $path='', int $depth=0): bool
1266
+    public function zip(ZipStream $archive, bool $self = true, ?INode $parent = null, string $path = '', int $depth = 0) : bool
1267 1267
     {
1268 1268
         if ($parent === null) {
1269 1269
             $parent = $this;
@@ -1325,7 +1325,7 @@  discard block
 block discarded – undo
1325 1325
      * @param   mixed $value
1326 1326
      * @return  INode
1327 1327
      */
1328
-    public function setMetaAttribute($attributes, $value=null): INode
1328
+    public function setMetaAttribute($attributes, $value = null): INode
1329 1329
     {
1330 1330
         $this->meta = self::validateMetaAttribute($attributes, $value, $this->meta);
1331 1331
         $this->save('meta');
@@ -1341,7 +1341,7 @@  discard block
 block discarded – undo
1341 1341
      * @param   array $set
1342 1342
      * @return  array
1343 1343
      */
1344
-    public static function validateMetaAttribute($attributes, $value=null, array $set=[]): array
1344
+    public static function validateMetaAttribute($attributes, $value = null, array $set = []): array
1345 1345
     {
1346 1346
         if (is_string($attributes)) {
1347 1347
             $attributes = [
@@ -1372,7 +1372,7 @@  discard block
 block discarded – undo
1372 1372
      * @param  string|array $attribute Specify attributes to return
1373 1373
      * @return string|array
1374 1374
      */
1375
-    public function getMetaAttribute($attribute=[])
1375
+    public function getMetaAttribute($attribute = [])
1376 1376
     {
1377 1377
         if (is_string($attribute)) {
1378 1378
             if (isset($this->meta[$attribute])) {
@@ -1392,7 +1392,7 @@  discard block
 block discarded – undo
1392 1392
      * @param   bool $readonly
1393 1393
      * @return  bool
1394 1394
      */
1395
-    public function setReadonly(bool $readonly=true): bool
1395
+    public function setReadonly(bool $readonly = true): bool
1396 1396
     {
1397 1397
         $this->readonly = $readonly;
1398 1398
         return $this->save('readonly');
@@ -1405,7 +1405,7 @@  discard block
 block discarded – undo
1405 1405
      * @param   UTCDateTime $ts
1406 1406
      * @return  bool
1407 1407
      */
1408
-    public function setDestroyable(?UTCDateTime $ts): bool
1408
+    public function setDestroyable(?UTCDateTime $ts) : bool
1409 1409
     {
1410 1410
         $this->destroy = $ts;
1411 1411
         
@@ -1428,7 +1428,7 @@  discard block
 block discarded – undo
1428 1428
      * @param   string $recursion
1429 1429
      * @return  bool
1430 1430
      */
1431
-    abstract public function delete(bool $force=false, ?string $recursion=null, bool $recursion_first=true): bool;
1431
+    abstract public function delete(bool $force = false, ?string $recursion = null, bool $recursion_first = true) : bool;
1432 1432
 
1433 1433
 
1434 1434
     /**
@@ -1498,7 +1498,7 @@  discard block
 block discarded – undo
1498 1498
      * @param  bool $recursion_first
1499 1499
      * @return bool
1500 1500
      */
1501
-    public function save($attributes=[], $remove=[], ?string $recursion=null, bool $recursion_first=true): bool
1501
+    public function save($attributes = [], $remove = [], ?string $recursion = null, bool $recursion_first = true) : bool
1502 1502
     {
1503 1503
         if (!$this->isAllowed('w') && !$this->isReference()) {
1504 1504
             throw new Exception\Forbidden('not allowed to modify node '.$this->name,
@@ -1531,7 +1531,7 @@  discard block
 block discarded – undo
1531 1531
             if (empty($update)) {
1532 1532
                 return false;
1533 1533
             } else {
1534
-                $result =$this->_db->storage->updateOne([
1534
+                $result = $this->_db->storage->updateOne([
1535 1535
                     '_id' => $this->_id,
1536 1536
                 ], $update);
1537 1537
             }
@@ -1567,7 +1567,7 @@  discard block
 block discarded – undo
1567 1567
      * @return  array
1568 1568
      */
1569 1569
     public static function loadNodeAttributesWithCustomFilter(
1570
-        ?array $filter = null,
1570
+        ? array $filter = null,
1571 1571
         array $attributes = ['_id'],
1572 1572
         ?int $limit = null,
1573 1573
         ?int &$cursor = null,
@@ -1583,7 +1583,7 @@  discard block
 block discarded – undo
1583 1583
 
1584 1584
         $search_attributes = array_merge($default, array_fill_keys($attributes, 1));
1585 1585
         $list   = [];
1586
-        $result =$this->_db->storage->find($filter, [
1586
+        $result = $this->_db->storage->find($filter, [
1587 1587
             'skip'      => $cursor,
1588 1588
             'limit'     => $limit,
1589 1589
             'projection'=> $search_attributes
Please login to merge, or discard this patch.