Completed
Push — master ( 786657...777126 )
by Raffael
02:57
created
src/lib/Balloon/Log/Adapter/AbstractAdapter.php 1 patch
Spacing   +3 added lines, -3 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
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      * @param Iterable $options
53 53
      * @return void
54 54
      */
55
-    public function __construct(?Iterable $config=null)
55
+    public function __construct(? Iterable $config = null)
56 56
     {
57 57
         $this->setOptions($config);
58 58
     }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      * @param   Iterable $options
96 96
      * @return  AdapterInterface
97 97
      */
98
-    public function setOptions(?Iterable $config=null): AdapterInterface
98
+    public function setOptions(? Iterable $config = null) : AdapterInterface
99 99
     {
100 100
         if ($config === null) {
101 101
             return $this;
Please login to merge, or discard this patch.
src/lib/Balloon/Log/Adapter/File.php 1 patch
Spacing   +2 added lines, -2 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
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      * @param   Iterable $options
36 36
      * @return  AdapterInterface
37 37
      */
38
-    public function setOptions(?Iterable $config=null): AdapterInterface
38
+    public function setOptions(? Iterable $config = null) : AdapterInterface
39 39
     {
40 40
         parent::setOptions($config);
41 41
         if ($config === null) {
Please login to merge, or discard this patch.
src/lib/Balloon/Log/Adapter/AdapterInterface.php 1 patch
Spacing   +3 added lines, -3 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
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      * @param Iterable $options
31 31
      * @return void
32 32
      */
33
-    public function __construct(?Iterable $config=null);
33
+    public function __construct(? Iterable $config = null);
34 34
     
35 35
 
36 36
     /**
@@ -61,5 +61,5 @@  discard block
 block discarded – undo
61 61
      * @param   Iterable $options
62 62
      * @return  AdapterInterface
63 63
      */
64
-    public function setOptions(?Iterable $config=null): AdapterInterface;
64
+    public function setOptions(? Iterable $config = null) : AdapterInterface;
65 65
 }
Please login to merge, or discard this patch.
src/lib/Balloon/Log/Adapter/Syslog.php 1 patch
Spacing   +2 added lines, -2 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
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      * @param   Iterable $options
44 44
      * @return  AdapterInterface
45 45
      */
46
-    public function setOptions(?Iterable $config=null)
46
+    public function setOptions(? Iterable $config = null)
47 47
     {
48 48
         parent::setOptions($options);
49 49
 
Please login to merge, or discard this patch.
src/lib/Balloon/Bootstrap/Http.php 1 patch
Spacing   +3 added lines, -3 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
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         parent::init();
40 40
         $this->setExceptionHandler();
41 41
 
42
-        $this->logger->info('processing incoming http ['. $_SERVER['REQUEST_METHOD'].'] request to ['.$_SERVER['REQUEST_URI'].']', [
42
+        $this->logger->info('processing incoming http ['.$_SERVER['REQUEST_METHOD'].'] request to ['.$_SERVER['REQUEST_URI'].']', [
43 43
             'category' => get_class($this),
44 44
         ]);
45 45
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
      */
126 126
     protected function setExceptionHandler(): Http
127 127
     {
128
-        set_exception_handler(function ($e) {
128
+        set_exception_handler(function($e) {
129 129
             $this->logger->emergency('uncaught exception: '.$e->getMessage(), [
130 130
                 'category' => get_class($this),
131 131
                 'exception' => $e
Please login to merge, or discard this patch.
src/lib/Balloon/Bootstrap/Cli.php 1 patch
Spacing   +2 added lines, -2 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
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
      */
116 116
     protected function setExceptionHandler(): Cli
117 117
     {
118
-        set_exception_handler(function ($e) {
118
+        set_exception_handler(function($e) {
119 119
             $this->logger->emergency('uncaught exception: '.$e->getMessage(), [
120 120
                 'category' => get_class($this),
121 121
                 'exception' => $e
Please login to merge, or discard this patch.
src/lib/Balloon/Bootstrap/AbstractCore.php 1 patch
Spacing   +3 added lines, -3 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
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      *
46 46
      * @var Config
47 47
      */
48
-    protected $option_log ;
48
+    protected $option_log;
49 49
 
50 50
 
51 51
     /**
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      */
143 143
     protected function setErrorHandler()
144 144
     {
145
-        set_error_handler(function ($errno, $errstr, $errfile, $errline) {
145
+        set_error_handler(function($errno, $errstr, $errfile, $errline) {
146 146
             $msg = $errstr." in ".$errfile.":".$errline;
147 147
             switch ($errno) {
148 148
                 case E_ERROR:
Please login to merge, or discard this patch.
src/lib/Balloon/Rest/v1/Node.php 1 patch
Spacing   +60 added lines, -60 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,7 +776,7 @@  discard block
 block discarded – undo
776 776
      * @param  array $attributes
777 777
      * @return Response
778 778
      */
779
-    public function getAttributes(?string $id=null, ?string $p=null, array $attributes=[]): Response
779
+    public function getAttributes(? string $id = null, ? string $p = null, array $attributes = []) : Response
780 780
     {
781 781
         $result = Helper::escape(
782 782
             $this->_getNode($id, $p)->getAttribute($attributes)
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
      * @param  array $attributes
897 897
      * @return Response
898 898
      */
899
-    public function getParent(?string $id=null, ?string $p=null, array $attributes=[]): Response
899
+    public function getParent(? string $id = null, ? string $p = null, array $attributes = []) : Response
900 900
     {
901 901
         $result = Helper::escape(
902 902
             $this->_getNode($id, $p)
@@ -978,7 +978,7 @@  discard block
 block discarded – undo
978 978
      * @param  array $attributes
979 979
      * @return Response
980 980
      */
981
-    public function getParents(?string $id=null, ?string $p=null, array $attributes=[], bool $self=false): Response
981
+    public function getParents(? string $id = null, ? string $p = null, array $attributes = [], bool $self = false) : Response
982 982
     {
983 983
         $request = $this->_getNode($id, $p);
984 984
         $parents = $request->getParents();
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
      * @param   string $p
1027 1027
      * @return  Response
1028 1028
      */
1029
-    public function postMetaAttributes(?string $id=null, ?string $p=null): Response
1029
+    public function postMetaAttributes(? string $id = null, ? string $p = null) : Response
1030 1030
     {
1031 1031
         $this->_getNode($id, $p)->setMetaAttribute(Helper::filter($_POST));
1032 1032
         return (new Response())->setCode(204);
@@ -1059,7 +1059,7 @@  discard block
 block discarded – undo
1059 1059
      * @param   string $name
1060 1060
      * @return  Response
1061 1061
      */
1062
-    public function postName(string $name, ?string $id=null, ?string $p=null): Response
1062
+    public function postName(string $name, ? string $id = null, ? string $p = null) : Response
1063 1063
     {
1064 1064
         $this->_getNode($id, $p)->setName($name);
1065 1065
         return (new Response())->setCode(204);
@@ -1097,11 +1097,11 @@  discard block
 block discarded – undo
1097 1097
      * @return  Response
1098 1098
      */
1099 1099
     public function postClone(
1100
-        $id=null,
1101
-        ?string $p=null,
1102
-        ?string $destid=null,
1103
-        ?string $destp=null,
1104
-        int $conflict=0): Response
1100
+        $id = null,
1101
+        ? string $p = null,
1102
+        ? string $destid = null,
1103
+        ? string $destp = null,
1104
+        int $conflict = 0) : Response
1105 1105
     {
1106 1106
         try {
1107 1107
             $parent = $this->_getNode($destid, $destp, 'Collection', false, true);
@@ -1183,11 +1183,11 @@  discard block
 block discarded – undo
1183 1183
      * @return  Response
1184 1184
      */
1185 1185
     public function postMove(
1186
-        $id=null,
1187
-        ?string $p=null,
1188
-        ?string $destid=null,
1189
-        ?string $destp=null,
1190
-        int $conflict=0): Response
1186
+        $id = null,
1187
+        ? string $p = null,
1188
+        ? string $destid = null,
1189
+        ? string $destp = null,
1190
+        int $conflict = 0) : Response
1191 1191
     {
1192 1192
         try {
1193 1193
             $parent = $this->_getNode($destid, $destp, 'Collection', false, true);
@@ -1267,11 +1267,11 @@  discard block
 block discarded – undo
1267 1267
      * @return  Response
1268 1268
      */
1269 1269
     public function delete(
1270
-        $id=null,
1271
-        ?string $p=null,
1272
-        bool $force=false,
1273
-        bool $ignore_flag=false,
1274
-        ?string $at=null): Response
1270
+        $id = null,
1271
+        ? string $p = null,
1272
+        bool $force = false,
1273
+        bool $ignore_flag = false,
1274
+        ? string $at = null) : Response
1275 1275
     {
1276 1276
         $failures = [];
1277 1277
             
@@ -1364,7 +1364,7 @@  discard block
 block discarded – undo
1364 1364
      * @param  array $attributes
1365 1365
      * @return Response
1366 1366
      */
1367
-    public function getQuery(int $deleted=0, array $filter=[], array $attributes=[]): Response
1367
+    public function getQuery(int $deleted = 0, array $filter = [], array $attributes = []): Response
1368 1368
     {
1369 1369
         $children = [];
1370 1370
         $nodes = $this->fs->findNodesWithCustomFilterUser($deleted, $filter);
@@ -1405,7 +1405,7 @@  discard block
 block discarded – undo
1405 1405
      * @param  array $attributes
1406 1406
      * @return Response
1407 1407
      */
1408
-    public function getTrash(array $attributes=[]): Response
1408
+    public function getTrash(array $attributes = []): Response
1409 1409
     {
1410 1410
         $children = [];
1411 1411
         $nodes = $this->fs->findNodesWithCustomFilterUser(INode::DELETED_ONLY, ['deleted' => ['$type' => 9]]);
@@ -1480,7 +1480,7 @@  discard block
 block discarded – undo
1480 1480
      * @param  int $deleted
1481 1481
      * @return Response
1482 1482
      */
1483
-    public function getSearch(array $query, array $attributes=[], int $deleted=0): Response
1483
+    public function getSearch(array $query, array $attributes = [], int $deleted = 0): Response
1484 1484
     {
1485 1485
         $children = [];
1486 1486
         $nodes = $this->fs->search($query, $deleted);
@@ -1590,11 +1590,11 @@  discard block
 block discarded – undo
1590 1590
      * @return  Response
1591 1591
      */
1592 1592
     public function getDelta(
1593
-        ?string $id=null,
1594
-        ?string $p=null,
1595
-        ?string $cursor=null,
1596
-        int $limit=250,
1597
-        array $attributes=[]): Response
1593
+        ? string $id = null,
1594
+        ? string $p = null,
1595
+        ? string $cursor = null,
1596
+        int $limit = 250,
1597
+        array $attributes = []) : Response
1598 1598
     {
1599 1599
         if ($id !== null || $p !== null) {
1600 1600
             $node = $this->_getNode($id, $p);
@@ -1602,7 +1602,7 @@  discard block
 block discarded – undo
1602 1602
             $node = null;
1603 1603
         }
1604 1604
         
1605
-        $result= $this->fs->getDelta()->getDeltaFeed($cursor, $limit, $attributes, $node);
1605
+        $result = $this->fs->getDelta()->getDeltaFeed($cursor, $limit, $attributes, $node);
1606 1606
 
1607 1607
         return (new Response())->setCode(200)->setBody($result);
1608 1608
     }
@@ -1710,7 +1710,7 @@  discard block
 block discarded – undo
1710 1710
      * @param  int $limit
1711 1711
      * @return Response
1712 1712
      */
1713
-    public function getEventLog(?string $id=null, ?string $p=null, int $skip=0, int $limit=100): Response
1713
+    public function getEventLog(? string $id = null, ? string $p = null, int $skip = 0, int $limit = 100) : Response
1714 1714
     {
1715 1715
         if ($id !== null || $p !== null) {
1716 1716
             $node = $this->_getNode($id, $p);
@@ -1750,7 +1750,7 @@  discard block
 block discarded – undo
1750 1750
      * @param   string $p
1751 1751
      * @return  Response
1752 1752
      */
1753
-    public function getLastCursor(?string $id=null, ?string $p=null): Response
1753
+    public function getLastCursor(? string $id = null, ? string $p = null) : Response
1754 1754
     {
1755 1755
         if ($id !== null || $p !== null) {
1756 1756
             $node = $this->_getNode($id, $p);
@@ -1758,7 +1758,7 @@  discard block
 block discarded – undo
1758 1758
             $node = null;
1759 1759
         }
1760 1760
 
1761
-        $result= $this->fs->getDelta()->getLastCursor();
1761
+        $result = $this->fs->getDelta()->getLastCursor();
1762 1762
         return (new Response())->setCode(200)->setBody($result);
1763 1763
     }
1764 1764
 }
Please login to merge, or discard this patch.
src/lib/Balloon/Rest/v1/Resource.php 1 patch
Spacing   +2 added lines, -2 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
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      * @param  bool $single
59 59
      * @return Response
60 60
      */
61
-    public function getAclRoles(string $q, bool $single=false): Response
61
+    public function getAclRoles(string $q, bool $single = false): Response
62 62
     {
63 63
         $resource = new UserResource($this->user, $this->logger, $this->fs);
64 64
         $result   = $resource->searchRole($q, $single);
Please login to merge, or discard this patch.