Completed
Push — master ( 2d4c67...9c9bdc )
by Raffael
08:15
created
src/lib/Balloon/Bootstrap/Http.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
 
99 99
             if (isset($app['enabled']) && $app['enabled'] != "1") {
100 100
                 $this->logger->debug('skip disabled app ['.$class.']', [
101
-                   'category' => get_class($this)
101
+                    'category' => get_class($this)
102 102
                 ]);
103 103
                 continue;
104 104
             }
Please login to merge, or discard this 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/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.
src/lib/Balloon/Rest/v1/Rest.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
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
                 $name  = $this->camelCase2Dashes($method->name);
158 158
                 $parts = explode('-', $name);
159 159
                 $verb  = strtoupper($parts[0]);
160
-                $func  = substr($name, strlen($verb)+1);
160
+                $func  = substr($name, strlen($verb) + 1);
161 161
                 $url   = '/rest/'.strtolower($controller).'/'.$func;
162 162
                 $doc   = $this->parsePhpDoc($method->getDocComment());
163 163
 
Please login to merge, or discard this patch.
src/lib/Balloon/Rest/v1/Collection.php 2 patches
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -231,7 +231,6 @@
 block discarded – undo
231 231
      *
232 232
      * @apiSuccessExample {json} Success-Response:
233 233
      * HTTP/1.1 204 No Content
234
-
235 234
      * @param  string $id
236 235
      * @param  string $p
237 236
      * @return Response
Please login to merge, or discard this 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/Config.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
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      * @param   string $config
43 43
      * @return  void
44 44
      */
45
-    public function __construct($config=[])
45
+    public function __construct($config = [])
46 46
     {
47 47
         if ($config instanceof ConfigInterface) {
48 48
             $this->store = $config->map();
Please login to merge, or discard this patch.
src/lib/Balloon/Plugin/AbstractPlugin.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
      * @return  void
278 278
      */
279 279
     public function preCopyFile(File $node, Collection $parent,
280
-       int $conflict, ?string $recursion, bool $recursion_first): void
280
+        int $conflict, ?string $recursion, bool $recursion_first): void
281 281
     {
282 282
     }
283 283
 
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
      * @return  void
297 297
      */
298 298
     public function postCopyFile(File $node, Collection $parent, File $new_node,
299
-       int $conflict, ?string $recursion, bool $recursion_first): void
299
+        int $conflict, ?string $recursion, bool $recursion_first): void
300 300
     {
301 301
     }
302 302
 
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 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 $config
53 53
      * @return PluginInterface
54 54
      */
55
-    public function setOptions(?Iterable $config): PluginInterface
55
+    public function setOptions(?Iterable $config) : PluginInterface
56 56
     {
57 57
         return $this;
58 58
     }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      * @param   array $params
77 77
      * @return  void
78 78
      */
79
-    public function __call(string $method, array $params=[]): void
79
+    public function __call(string $method, array $params = []): void
80 80
     {
81 81
         if (!is_callable([$this, $method])) {
82 82
             throw new Exception('invalid plugin call ['.$this->getName().'], hook ['.$method.'] does not exists');
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
      * @param   mixed $content
146 146
      * @return  void
147 147
      */
148
-    public function preHttpResponse(\Balloon\Http\Response $response, int &$code, &$content): void
148
+    public function preHttpResponse(\Balloon\Http\Response $response, int&$code, &$content): void
149 149
     {
150 150
     }
151 151
     
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
      * @param   bool $clone
177 177
      * @return  void
178 178
      */
179
-    public function preCreateCollection(Collection $parent, string &$name, array &$attributes, bool $clone): void
179
+    public function preCreateCollection(Collection $parent, string&$name, array &$attributes, bool $clone): void
180 180
     {
181 181
     }
182 182
     
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
      * @param   bool $clone
208 208
      * @return  void
209 209
      */
210
-    public function preCreateFile(Collection $parent, string &$name, array &$attributes, bool $clone): void
210
+    public function preCreateFile(Collection $parent, string&$name, array &$attributes, bool $clone): void
211 211
     {
212 212
     }
213 213
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
      * @return  void
241 241
      */
242 242
     public function preCopyCollection(Collection $node, Collection $parent,
243
-        int $conflict, ?string $recursion, bool $recursion_first): void
243
+        int $conflict, ?string $recursion, bool $recursion_first) : void
244 244
     {
245 245
     }
246 246
 
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
      * @return  void
260 260
      */
261 261
     public function postCopyCollection(Collection $node, Collection $parent,
262
-        Collection $new_node, int $conflict, ?string $recursion, bool $recursion_first): void
262
+        Collection $new_node, int $conflict, ?string $recursion, bool $recursion_first) : void
263 263
     {
264 264
     }
265 265
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
      * @return  void
278 278
      */
279 279
     public function preCopyFile(File $node, Collection $parent,
280
-       int $conflict, ?string $recursion, bool $recursion_first): void
280
+       int $conflict, ?string $recursion, bool $recursion_first) : void
281 281
     {
282 282
     }
283 283
 
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
      * @return  void
297 297
      */
298 298
     public function postCopyFile(File $node, Collection $parent, File $new_node,
299
-       int $conflict, ?string $recursion, bool $recursion_first): void
299
+       int $conflict, ?string $recursion, bool $recursion_first) : void
300 300
     {
301 301
     }
302 302
 
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
      * @param   bool $recursion_first
313 313
      * @return  void
314 314
      */
315
-    public function preDeleteCollection(Collection $node, bool $force, ?string $recursion, bool $recursion_first): void
315
+    public function preDeleteCollection(Collection $node, bool $force, ?string $recursion, bool $recursion_first) : void
316 316
     {
317 317
     }
318 318
 
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
      * @param   bool $recursion_first
329 329
      * @return  void
330 330
      */
331
-    public function postDeleteCollection(Collection $node, bool $force, ?string $recursion, bool $recursion_first): void
331
+    public function postDeleteCollection(Collection $node, bool $force, ?string $recursion, bool $recursion_first) : void
332 332
     {
333 333
     }
334 334
     
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
      * @param   int $version
343 343
      * @return  void
344 344
      */
345
-    public function preRestoreFile(File $node, int $version): void
345
+    public function preRestoreFile(File $node, int $version) : void
346 346
     {
347 347
     }
348 348
 
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
      * @param   int $version
357 357
      * @return  void
358 358
      */
359
-    public function postRestoreFile(File $node, int $version): void
359
+    public function postRestoreFile(File $node, int $version) : void
360 360
     {
361 361
     }
362 362
 
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
      * @param   array $attributes
373 373
      * @return  void
374 374
      */
375
-    public function prePutFile(File $node, $content, bool $force, array $attributes): void
375
+    public function prePutFile(File $node, $content, bool $force, array $attributes) : void
376 376
     {
377 377
     }
378 378
     
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
      * @param   array $attributes
389 389
      * @return  void
390 390
      */
391
-    public function postPutFile(File $node, $content, bool $force, array $attributes): void
391
+    public function postPutFile(File $node, $content, bool $force, array $attributes) : void
392 392
     {
393 393
     }
394 394
    
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
      * @param   bool $recursion_first
405 405
      * @return  void
406 406
      */
407
-    public function preDeleteFile(File $node, bool $force, ?string $recursion, bool $recursion_first): void
407
+    public function preDeleteFile(File $node, bool $force, ?string $recursion, bool $recursion_first) : void
408 408
     {
409 409
     }
410 410
 
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
      * @param   bool $recursion_first
421 421
      * @return  void
422 422
      */
423
-    public function postDeleteFile(File $node, bool $force, ?string $recursion, bool $recursion_first): void
423
+    public function postDeleteFile(File $node, bool $force, ?string $recursion, bool $recursion_first) : void
424 424
     {
425 425
     }
426 426
 
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
      * @return  void
439 439
      */
440 440
     public function preSaveNodeAttributes(INode $node, array &$save_attributes,
441
-        array &$remove_attributes, ?string $recursion, bool $recursion_first): void
441
+        array &$remove_attributes, ?string $recursion, bool $recursion_first) : void
442 442
     {
443 443
     }
444 444
 
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
      * @return void
457 457
      */
458 458
     public function postSaveNodeAttributes(INode $node, array $save_attributes,
459
-        array $remove_attributes, ?string $recursion, bool $recursion_first): void
459
+        array $remove_attributes, ?string $recursion, bool $recursion_first) : void
460 460
     {
461 461
     }
462 462
     
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
      * @param   bool $autocreate
473 473
      * @return  void
474 474
      */
475
-    public function preInstanceUser(\Balloon\User $user, string &$username, ?array &$attributes, bool $autocreate): void
475
+    public function preInstanceUser(\Balloon\User $user, string&$username, ? array &$attributes, bool $autocreate) : void
476 476
     {
477 477
     }
478 478
 
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
      * @param   \Balloon\User $user
486 486
      * @return  void
487 487
      */
488
-    public function postInstanceUser(\Balloon\User $user): void
488
+    public function postInstanceUser(\Balloon\User $user) : void
489 489
     {
490 490
     }
491 491
 }
Please login to merge, or discard this patch.
src/lib/Balloon/Plugin/AutoCreateUser.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
         }
65 65
 
66 66
         $this->logger->info('found first time username ['.$username.'], auto-create user in mongodb user collection', [
67
-             'category' => get_class($this)
67
+                'category' => get_class($this)
68 68
         ]);
69 69
 
70 70
         $attributes = [
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 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
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      * @param  Iterable $config
33 33
      * @return PluginInterface
34 34
      */
35
-    public function setOptions(?Iterable $config): PluginInterface
35
+    public function setOptions(?Iterable $config) : PluginInterface
36 36
     {
37 37
         if ($config === null) {
38 38
             return $this;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      * @param   bool $autocreate
58 58
      * @return  void
59 59
      */
60
-    public function preInstanceUser(User $user, string &$username, ?array &$attributes, bool $autocreate): void
60
+    public function preInstanceUser(User $user, string&$username, ? array &$attributes, bool $autocreate) : void
61 61
     {
62 62
         if ($autocreate === false || $attributes !== null) {
63 63
             return;
@@ -84,19 +84,19 @@  discard block
 block discarded – undo
84 84
             
85 85
             switch ($value['type']) {
86 86
                 case 'string':
87
-                     $attributes[$attr]  = (string)$value['value'];
87
+                     $attributes[$attr] = (string)$value['value'];
88 88
                 break;
89 89
                                         
90 90
                 case 'int':
91
-                     $attributes[$attr]  = (int)$value['value'];
91
+                     $attributes[$attr] = (int)$value['value'];
92 92
                 break;
93 93
                                         
94 94
                 case 'bool':
95
-                     $attributes[$attr]  = (bool)$value['value'];
95
+                     $attributes[$attr] = (bool)$value['value'];
96 96
                 break;
97 97
                 
98 98
                 case 'binary':
99
-                     $attributes[$attr]  = new Binary($value['value']);
99
+                     $attributes[$attr] = new Binary($value['value']);
100 100
                 break;
101 101
                 
102 102
                 default:
Please login to merge, or discard this patch.
src/lib/Balloon/App/AbstractApp.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
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         $this->logger   = $logger;
108 108
         $this->fs       = $fs;
109 109
         $this->db       = $fs->getDatabase();
110
-        $this->pluginmgr= $fs->getPlugin();
110
+        $this->pluginmgr = $fs->getPlugin();
111 111
         $this->queuemgr = $fs->getQueue();
112 112
         $this->auth     = $auth;
113 113
 
Please login to merge, or discard this patch.