Completed
Branch dev (d5d70c)
by Raffael
11:00
created
src/app/Balloon.App.Office/Api/v2/Documents.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,6 @@
 block discarded – undo
20 20
 use Balloon\Filesystem\Node\Collection;
21 21
 use Balloon\Filesystem\Node\File;
22 22
 use Balloon\Server;
23
-use Balloon\Server\User;
24 23
 use Micro\Http\Response;
25 24
 
26 25
 class Documents extends Controller
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
@@ -101,10 +101,10 @@  discard block
 block discarded – undo
101 101
 
102 102
         foreach ($document->getSessions() as $session) {
103 103
             $sessions[] = [
104
-                'id' => (string) $session['_id'],
104
+                'id' => (string)$session['_id'],
105 105
                 'created' => $session['_id']->getTimestamp(),
106 106
                 'user' => [
107
-                    'id' => (string) $session['user'],
107
+                    'id' => (string)$session['user'],
108 108
                     'name' => $this->server->getUserById($session['user'])->getUsername(),
109 109
                 ],
110 110
             ];
Please login to merge, or discard this patch.
src/app/Balloon.App.Elasticsearch/Job.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         foreach ($config as $option => $value) {
110 110
             switch ($option) {
111 111
                 case 'size_limit':
112
-                    $this->size_limit = (int) $value;
112
+                    $this->size_limit = (int)$value;
113 113
 
114 114
                 break;
115 115
                 default:
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
         ]);
218 218
 
219 219
         $params = [
220
-            'id' => (string) $node,
220
+            'id' => (string)$node,
221 221
             'type' => 'storage',
222 222
             'index' => $this->es->getIndex(),
223 223
         ];
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
         ]);
243 243
 
244 244
         $params = [
245
-            'id' => (string) $node,
245
+            'id' => (string)$node,
246 246
             'type' => 'storage',
247 247
             'index' => $this->es->getIndex(),
248 248
         ];
@@ -263,10 +263,10 @@  discard block
 block discarded – undo
263 263
      */
264 264
     protected function setMemoryLimit(): self
265 265
     {
266
-        $limit = (int) ini_get('memory_limit') * 1024 * 1024;
266
+        $limit = (int)ini_get('memory_limit') * 1024 * 1024;
267 267
         $required = $this->size_limit * 2;
268 268
         if ($limit !== -1 && $limit < $limit + $required) {
269
-            ini_set('memory_limit', (string) (($limit + $required) * 1024 * 1024));
269
+            ini_set('memory_limit', (string)(($limit + $required) * 1024 * 1024));
270 270
         }
271 271
 
272 272
         return $this;
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
     {
284 284
         return [
285 285
             'index' => $this->es->getIndex(),
286
-            'id' => (string) $node->getId(),
286
+            'id' => (string)$node->getId(),
287 287
             'type' => 'storage',
288 288
         ];
289 289
     }
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
     {
301 301
         $params = [
302 302
             'index' => $this->es->getIndex(),
303
-            'id' => (string) $storage_reference['_id'],
303
+            'id' => (string)$storage_reference['_id'],
304 304
             'type' => 'fs',
305 305
         ];
306 306
 
@@ -342,11 +342,11 @@  discard block
 block discarded – undo
342 342
         $content = json_encode(base64_encode(stream_get_contents($node->get())));
343 343
 
344 344
         $metadata = $meta['metadata'];
345
-        array_walk_recursive($metadata, function (&$value) { $value = (string) $value; });
345
+        array_walk_recursive($metadata, function(&$value) { $value = (string)$value; });
346 346
 
347 347
         $params = [
348 348
             'index' => $this->es->getIndex(),
349
-            'id' => (string) $meta['_id'],
349
+            'id' => (string)$meta['_id'],
350 350
             'type' => 'fs',
351 351
             'body' => [
352 352
                 'metadata' => $metadata,
Please login to merge, or discard this patch.
src/app/Balloon.App.Convert/Constructor/Http.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             ->prependRoute(new Route('/api/v2/files/convert', Convert::class))
35 35
             ->prependRoute(new Route('/api/v2/files/{id:#([0-9a-z]{24})#}/convert', Convert::class));
36 36
 
37
-        $decorator->addDecorator('master', function ($node) use ($fs, $decorator) {
37
+        $decorator->addDecorator('master', function($node) use ($fs, $decorator) {
38 38
             $master = $node->getAppAttribute('Balloon\\App\\Convert', 'master');
39 39
             if (null === $master) {
40 40
                 return null;
Please login to merge, or discard this patch.
src/app/Balloon.App.Convert/Api/v2/Convert.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
@@ -106,13 +106,13 @@  discard block
 block discarded – undo
106 106
 
107 107
         foreach ($this->converter->getSlaves($file) as $slave) {
108 108
             $element = [
109
-                'id' => (string) $slave['_id'],
110
-                'master' => (string) $slave['master'],
109
+                'id' => (string)$slave['_id'],
110
+                'master' => (string)$slave['master'],
111 111
                 'format' => $slave['format'],
112 112
             ];
113 113
 
114 114
             if (isset($slave['slave'])) {
115
-                $element['slave'] = (string) $slave['slave'];
115
+                $element['slave'] = (string)$slave['slave'];
116 116
             }
117 117
 
118 118
             $body[] = $element;
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
         $id = $this->converter->addSlave($file, $format);
152 152
 
153 153
         return (new Response())->setCode(200)->setBody([
154
-            'id' => (string) $id,
155
-            'master' => (string) $file->getId(),
154
+            'id' => (string)$id,
155
+            'master' => (string)$file->getId(),
156 156
             'format' => $format,
157 157
         ]);
158 158
     }
Please login to merge, or discard this patch.
src/app/Balloon.App.DesktopClient/DesktopClient.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
@@ -93,11 +93,11 @@  discard block
 block discarded – undo
93 93
                 case 'github_request_url':
94 94
                 case 'github_request_timeout':
95 95
                 case 'github_request_useragent':
96
-                    $this->{$option} = (string) $value;
96
+                    $this->{$option} = (string)$value;
97 97
 
98 98
                 break;
99 99
                 case 'github_request_timeout':
100
-                    $this->github_request_timeout = (int) $value;
100
+                    $this->github_request_timeout = (int)$value;
101 101
 
102 102
                 break;
103 103
                 case 'formats':
Please login to merge, or discard this patch.
src/app/Balloon.App.DesktopClient/Api/v2/Download.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             ->setHeader('Content-Type', 'application/octet-stream')
65 65
             ->setHeader('Content-Transfer-Encoding', 'binary')
66 66
             ->setOutputFormat(null)
67
-            ->setBody(function () use ($url) {
67
+            ->setBody(function() use ($url) {
68 68
                 $stream = fopen($url, 'r');
69 69
                 while (!feof($stream)) {
70 70
                     echo fread($stream, 8192);
Please login to merge, or discard this patch.
src/app/Balloon.App.Sharelink/Constructor/Http.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             }
71 71
         });
72 72
 
73
-        $decorator->addDecorator('sharelink_token', function ($node) use ($sharelink) {
73
+        $decorator->addDecorator('sharelink_token', function($node) use ($sharelink) {
74 74
             $attributes = $sharelink->getSharelink($node);
75 75
 
76 76
             if (isset($attributes['token'])) {
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             }
79 79
         });
80 80
 
81
-        $decorator->addDecorator('sharelink_expire', function ($node) use ($sharelink) {
81
+        $decorator->addDecorator('sharelink_expire', function($node) use ($sharelink) {
82 82
             $attributes = $sharelink->getSharelink($node);
83 83
 
84 84
             if (isset($attributes['expiration'])) {
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         if (isset($_GET['t']) && !empty($_GET['t'])) {
103 103
             $token = $_GET['t'];
104 104
             if (isset($_GET['download'])) {
105
-                $download = (bool) $_GET['download'];
105
+                $download = (bool)$_GET['download'];
106 106
             } else {
107 107
                 $download = false;
108 108
             }
Please login to merge, or discard this patch.
src/app/Balloon.App.Notification/Constructor/Http.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
@@ -33,35 +33,35 @@  discard block
 block discarded – undo
33 33
             ->prependRoute(new Route('/api/v2/notifications', Api::class))
34 34
             ->prependRoute(new Route('/api/v2/notifications/{id:#([0-9a-z]{24})#}', Api::class));
35 35
 
36
-        $decorator->addDecorator('subscription', function ($node) use ($server) {
36
+        $decorator->addDecorator('subscription', function($node) use ($server) {
37 37
             $subscription = $node->getAppAttribute('Balloon\\App\\Notification', 'subscription');
38 38
 
39 39
             if (is_array($subscription)) {
40
-                return isset($subscription[(string) $server->getIdentity()->getId()]);
40
+                return isset($subscription[(string)$server->getIdentity()->getId()]);
41 41
             }
42 42
 
43 43
             return false;
44 44
         });
45 45
 
46
-        $decorator->addDecorator('subscription_exclude_me', function ($node) use ($server) {
46
+        $decorator->addDecorator('subscription_exclude_me', function($node) use ($server) {
47 47
             $subscription = $node->getAppAttribute('Balloon\\App\\Notification', 'subscription');
48 48
 
49
-            if (is_array($subscription) && isset($subscription[(string) $server->getIdentity()->getId()]['exclude_me'])) {
50
-                return $subscription[(string) $server->getIdentity()->getId()]['exclude_me'];
49
+            if (is_array($subscription) && isset($subscription[(string)$server->getIdentity()->getId()]['exclude_me'])) {
50
+                return $subscription[(string)$server->getIdentity()->getId()]['exclude_me'];
51 51
             }
52 52
 
53 53
             return false;
54 54
         });
55 55
 
56
-        $decorator->addDecorator('subscription_recursive', function ($node) use ($server) {
56
+        $decorator->addDecorator('subscription_recursive', function($node) use ($server) {
57 57
             if (!($node instanceof Collection)) {
58 58
                 return null;
59 59
             }
60 60
 
61 61
             $subscription = $node->getAppAttribute('Balloon\\App\\Notification', 'subscription');
62 62
 
63
-            if (is_array($subscription) && isset($subscription[(string) $server->getIdentity()->getId()]['recursive'])) {
64
-                return $subscription[(string) $server->getIdentity()->getId()]['recursive'];
63
+            if (is_array($subscription) && isset($subscription[(string)$server->getIdentity()->getId()]['recursive'])) {
64
+                return $subscription[(string)$server->getIdentity()->getId()]['recursive'];
65 65
             }
66 66
 
67 67
             return false;
Please login to merge, or discard this patch.
src/app/Balloon.App.Notification/Api/v2/Notification.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         $body = [];
135 135
         foreach ($this->notifier->getNotifications($this->user) as $message) {
136 136
             $note = $message;
137
-            $note['id'] = (string) $note['_id'];
137
+            $note['id'] = (string)$note['_id'];
138 138
             unset($note['_id'], $note['receiver']);
139 139
 
140 140
             $note['sender'] = $this->role_decorator->decorate($this->server->getUserById($note['sender']), ['id', 'username']);
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
                     $this->notifier->subscribeNode($this->fs->getNode($id, $p), $subscribe);
274 274
                 } catch (\Exception $e) {
275 275
                     $failures[] = [
276
-                        'id' => (string) $node->getId(),
276
+                        'id' => (string)$node->getId(),
277 277
                         'name' => $node->getName(),
278 278
                         'error' => get_class($e),
279 279
                         'message' => $e->getMessage(),
Please login to merge, or discard this patch.