Completed
Branch dev (09647c)
by Raffael
11:14
created
src/app/Balloon.App.Office/Api/Latest/Document.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 Document extends Controller
Please login to merge, or discard this 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
@@ -94,10 +94,10 @@  discard block
 block discarded – undo
94 94
 
95 95
         foreach ($document->getSessions() as $session) {
96 96
             $sessions[] = [
97
-                'id' => (string) $session['_id'],
97
+                'id' => (string)$session['_id'],
98 98
                 'created' => $session['_id']->getTimestamp(),
99 99
                 'user' => [
100
-                    'id' => (string) $session['user'],
100
+                    'id' => (string)$session['user'],
101 101
                     'name' => $this->server->getUserById($session['user'])->getUsername(),
102 102
                 ],
103 103
             ];
@@ -165,6 +165,6 @@  discard block
 block discarded – undo
165 165
         $tpl = new Template($type);
166 166
         $result = $parent->addFile($name, $tpl->get(), $attributes);
167 167
 
168
-        return (new Response())->setCode(201)->setBody((string) $result->getId());
168
+        return (new Response())->setCode(201)->setBody((string)$result->getId());
169 169
     }
170 170
 }
Please login to merge, or discard this patch.
src/app/Balloon.App.Office/Api/Latest/Wopi/Document.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -151,7 +151,6 @@
 block discarded – undo
151 151
      * Get by access token.
152 152
      *
153 153
      * @param string $id
154
-     * @param string $access_token
155 154
      *
156 155
      * @return Session
157 156
      */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
Please login to merge, or discard this patch.
src/lib/Console.php 2 patches
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
     /**
174 174
      * Configure cli logger.
175 175
      *
176
-     * @return Cli
176
+     * @return Console
177 177
      */
178 178
     protected function configureLogger(?int $level = null): self
179 179
     {
@@ -264,7 +264,6 @@  discard block
 block discarded – undo
264 264
     /**
265 265
      * Start.
266 266
      *
267
-     * @param array $options
268 267
      *
269 268
      * @return bool
270 269
      */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
Please login to merge, or discard this patch.
src/lib/Console/Jobs.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,6 @@
 block discarded – undo
50 50
     /**
51 51
      * Constructor.
52 52
      *
53
-     * @param App             $app
54 53
      * @param Async           $async
55 54
      * @param LoggerInterface $logger
56 55
      * @param GetOpt          $getopt
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
Please login to merge, or discard this patch.
src/lib/Filesystem/Delta.php 2 patches
Doc Comments   -2 removed lines patch added patch discarded remove patch
@@ -80,9 +80,7 @@
 block discarded – undo
80 80
     /**
81 81
      * Add delta event.
82 82
      *
83
-     * @param string        $name
84 83
      * @param NodeInterface $node
85
-     * @param array         $options
86 84
      *
87 85
      * @return ObjectId
88 86
      */
Please login to merge, or discard this 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
@@ -282,13 +282,13 @@  discard block
 block discarded – undo
282 282
             }
283 283
 
284 284
             $result = $this->db->delta->find($filter, [
285
-                'skip' => (int) $cursor[1],
286
-                'limit' => (int) $limit,
285
+                'skip' => (int)$cursor[1],
286
+                'limit' => (int)$limit,
287 287
                 'sort' => ['timestamp' => 1],
288 288
             ]);
289 289
 
290 290
             $left = $this->db->delta->count($filter, [
291
-                'skip' => (int) $cursor[1],
291
+                'skip' => (int)$cursor[1],
292 292
                 'sort' => ['timestamp' => 1],
293 293
             ]);
294 294
 
@@ -309,8 +309,8 @@  discard block
 block discarded – undo
309 309
 
310 310
         foreach ($result as $log) {
311 311
             if (false === $has_more) {
312
-                $last_id = (string) $log['_id'];
313
-                $last_ts = (string) $log['timestamp'];
312
+                $last_id = (string)$log['_id'];
313
+                $last_ts = (string)$log['timestamp'];
314 314
             }
315 315
 
316 316
             try {
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
                     }
358 358
 
359 359
                     $deleted_node = [
360
-                        'id' => (string) $log['node'],
360
+                        'id' => (string)$log['node'],
361 361
                         'deleted' => true,
362 362
                         'created' => null,
363 363
                         'changed' => Helper::DateTimeToUnix($log['timestamp']),
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
                     }
383 383
 
384 384
                     $entry = [
385
-                        'id' => (string) $log['node'],
385
+                        'id' => (string)$log['node'],
386 386
                         'deleted' => true,
387 387
                         'created' => null,
388 388
                         'changed' => Helper::DateTimeToUnix($log['timestamp']),
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
         if (5 !== count($cursor)) {
537 537
             return null;
538 538
         }
539
-        $cursor[1] = (int) $cursor[1];
539
+        $cursor[1] = (int)$cursor[1];
540 540
 
541 541
         return $cursor;
542 542
     }
Please login to merge, or discard this patch.
src/lib/Filesystem/Node/AttributeDecorator.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
      *
61 61
      * @param Server    $server
62 62
      * @param Acl       $acl
63
-     * @param Decorator $role_decorator
63
+     * @param RoleAttributeDecorator $role_decorator
64 64
      */
65 65
     public function __construct(Server $server, Acl $acl, RoleAttributeDecorator $role_decorator)
66 66
     {
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
@@ -125,25 +125,25 @@  discard block
 block discarded – undo
125 125
         $decorator = $this->role_decorator;
126 126
 
127 127
         return [
128
-            'id' => (string) $attributes['id'],
129
-            'name' => (string) $attributes['name'],
130
-            'mime' => (string) $attributes['mime'],
131
-            'readonly' => (bool) $attributes['readonly'],
128
+            'id' => (string)$attributes['id'],
129
+            'name' => (string)$attributes['name'],
130
+            'mime' => (string)$attributes['mime'],
131
+            'readonly' => (bool)$attributes['readonly'],
132 132
             'directory' => $node instanceof Collection,
133
-            'meta' => function ($node) {
134
-                return (object) $node->getMetaAttributes();
133
+            'meta' => function($node) {
134
+                return (object)$node->getMetaAttributes();
135 135
             },
136
-            'size' => function ($node) {
136
+            'size' => function($node) {
137 137
                 return $node->getSize();
138 138
             },
139
-            'path' => function ($node) {
139
+            'path' => function($node) {
140 140
                 try {
141 141
                     return $node->getPath();
142 142
                 } catch (\Exception $e) {
143 143
                     return null;
144 144
                 }
145 145
             },
146
-            'parent' => function ($node) {
146
+            'parent' => function($node) {
147 147
                 $parent = $node->getParent();
148 148
 
149 149
                 if (null === $parent || $parent->isRoot()) {
@@ -152,10 +152,10 @@  discard block
 block discarded – undo
152 152
 
153 153
                 return $this->decorate($node->getParent(), ['id', 'name', '_links']);
154 154
             },
155
-            'access' => function ($node) use ($acl) {
155
+            'access' => function($node) use ($acl) {
156 156
                 return $acl->getAclPrivilege($node);
157 157
             },
158
-            'share' => function ($node) {
158
+            'share' => function($node) {
159 159
                 if ($node->isShared() || !$node->isSpecial()) {
160 160
                     return null;
161 161
                 }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
                     return null;
167 167
                 }
168 168
             },
169
-            'sharename' => function ($node) {
169
+            'sharename' => function($node) {
170 170
                 if (!$node->isShared()) {
171 171
                     return null;
172 172
                 }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                     return null;
178 178
                 }
179 179
             },
180
-            'shareowner' => function ($node) use ($server, $fs, $decorator) {
180
+            'shareowner' => function($node) use ($server, $fs, $decorator) {
181 181
                 if (!$node->isSpecial()) {
182 182
                     return null;
183 183
                 }
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
                     return null;
192 192
                 }
193 193
             },
194
-            'owner' => function ($node) use ($server, $decorator) {
194
+            'owner' => function($node) use ($server, $decorator) {
195 195
                 try {
196 196
                     return $decorator->decorate(
197 197
                         $server->getUserById($node->getOwner()),
@@ -215,20 +215,20 @@  discard block
 block discarded – undo
215 215
     protected function getTimeAttributes(NodeInterface $node, array $attributes): array
216 216
     {
217 217
         return [
218
-            'created' => function ($node) use ($attributes) {
218
+            'created' => function($node) use ($attributes) {
219 219
                 return $attributes['created']->toDateTime()->format('c');
220 220
             },
221
-            'changed' => function ($node) use ($attributes) {
221
+            'changed' => function($node) use ($attributes) {
222 222
                 return $attributes['changed']->toDateTime()->format('c');
223 223
             },
224
-            'deleted' => function ($node) use ($attributes) {
224
+            'deleted' => function($node) use ($attributes) {
225 225
                 if (false === $attributes['deleted']) {
226 226
                     return null;
227 227
                 }
228 228
 
229 229
                 return $attributes['deleted']->toDateTime()->format('c');
230 230
             },
231
-            'destroy' => function ($node) use ($attributes) {
231
+            'destroy' => function($node) use ($attributes) {
232 232
                 if (null === $attributes['destroy']) {
233 233
                     return null;
234 234
                 }
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
         return [
262 262
             'shared' => $node->isShared(),
263 263
             'reference' => $node->isReference(),
264
-            'filter' => function ($node) use ($attributes) {
264
+            'filter' => function($node) use ($attributes) {
265 265
                 if (null === $attributes['filter']) {
266 266
                     return null;
267 267
                 }
Please login to merge, or discard this patch.
src/lib/Filesystem/Node/NodeInterface.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -106,14 +106,13 @@  discard block
 block discarded – undo
106 106
      *
107 107
      * @param bool $reference
108 108
      *
109
-     * @return ObjectId
109
+     * @return ObjectId|null
110 110
      */
111 111
     public function getShareId(bool $reference = false): ?ObjectId;
112 112
 
113 113
     /**
114 114
      * Get share node.
115 115
      *
116
-     * @param bool $reference
117 116
      *
118 117
      * @return Collection
119 118
      */
@@ -236,6 +235,7 @@  discard block
 block discarded – undo
236 235
 
237 236
     /**
238 237
      * Download.
238
+     * @return resource
239 239
      */
240 240
     public function get();
241 241
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
Please login to merge, or discard this patch.
src/app/Balloon.App.Office/Session/Member.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
@@ -140,8 +140,8 @@  discard block
 block discarded – undo
140 140
             'BaseFileName' => $attrs['name'],
141 141
             'Size' => $doc->getSize(),
142 142
             'Version' => $attrs['version'],
143
-            'OwnerId' => (string) $doc->getNode()->getOwner(),
144
-            'UserId' => (string) $this->user->getId(),
143
+            'OwnerId' => (string)$doc->getNode()->getOwner(),
144
+            'UserId' => (string)$this->user->getId(),
145 145
             'UserFriendlyName' => $this->user->getUsername(),
146 146
             'UserCanWrite' => true,
147 147
             'PostMessageOrigin' => null,
Please login to merge, or discard this patch.
src/app/Balloon.App.Office/Api/Latest/Session.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
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
                 ->store();
101 101
 
102 102
         return (new Response())->setCode(201)->setBody([
103
-            'id' => (string) $session->getId(),
103
+            'id' => (string)$session->getId(),
104 104
             'wopi_url' => $this->app->getWopiUrl(),
105 105
             'access_token' => $member->getAccessToken(),
106 106
             'access_token_ttl' => ($member->getTTL()->toDateTime()->format('U') * 1000),
Please login to merge, or discard this patch.