Completed
Branch dev (d5d70c)
by Raffael
11:00
created
src/lib/Hook/AbstractHook.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
     public function preCopyFile(
117 117
         File $node,
118 118
         Collection $parent,
119
-       int $conflict,
119
+        int $conflict,
120 120
         ?string $recursion,
121 121
         bool $recursion_first
122 122
     ): void {
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         File $node,
130 130
         Collection $parent,
131 131
         File $new_node,
132
-       int $conflict,
132
+        int $conflict,
133 133
         ?string $recursion,
134 134
         bool $recursion_first
135 135
     ): void {
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/Hook/HookInterface.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
     public function preCopyFile(
207 207
         File $node,
208 208
         Collection $parent,
209
-       int $conflict,
209
+        int $conflict,
210 210
         ?string $recursion,
211 211
         bool $recursion_first
212 212
     ): void;
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
         File $node,
228 228
         Collection $parent,
229 229
         File $new_node,
230
-       int $conflict,
230
+        int $conflict,
231 231
         ?string $recursion,
232 232
         bool $recursion_first
233 233
     ): void;
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/Template.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,6 +85,6 @@
 block discarded – undo
85 85
     protected function getTemplate(): string
86 86
     {
87 87
         return __DIR__.DIRECTORY_SEPARATOR.'assets'
88
-          .DIRECTORY_SEPARATOR.'template.'.$this->type;
88
+            .DIRECTORY_SEPARATOR.'template.'.$this->type;
89 89
     }
90 90
 }
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.Preview/Hook.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,6 @@
 block discarded – undo
12 12
 
13 13
 namespace Balloon\App\Preview;
14 14
 
15
-use Balloon\Exception;
16 15
 use Balloon\Filesystem\Node\File;
17 16
 use Balloon\Hook\AbstractHook;
18 17
 use MongoDB\GridFS\Exception\FileNotFoundException;
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/Node/File.php 4 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
      * @param string $path
695 695
      * @param bool   $new
696 696
      *
697
-     * @return bool
697
+     * @return string
698 698
      */
699 699
     protected function verifyFile(?string $path, bool $new = false): string
700 700
     {
@@ -827,7 +827,7 @@  discard block
 block discarded – undo
827 827
     /**
828 828
      * Finalize put request.
829 829
      *
830
-     * @param resource|string $file
830
+     * @param string|null $file
831 831
      * @param bool            $new
832 832
      * @param array           $attributes
833 833
      *
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -589,7 +589,7 @@
 block discarded – undo
589 589
         ]);
590 590
 
591 591
         $this->addVersion($attributes)
592
-             ->postPutFile($file, $new, $attributes);
592
+                ->postPutFile($file, $new, $attributes);
593 593
 
594 594
         return $this->version;
595 595
     }
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,6 @@
 block discarded – undo
18 18
 use Balloon\Filesystem\Storage;
19 19
 use Balloon\Hook;
20 20
 use Balloon\Mime;
21
-use Balloon\Server\User;
22 21
 use MongoDB\BSON\UTCDateTime;
23 22
 use Psr\Log\LoggerInterface;
24 23
 
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 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
@@ -44,14 +44,14 @@  discard block
 block discarded – undo
44 44
      * @param array
45 45
      **/
46 46
     protected $temp_files = [
47
-        '/^\._(.*)$/',     // OS/X resource forks
48
-        '/^.DS_Store$/',   // OS/X custom folder settings
47
+        '/^\._(.*)$/', // OS/X resource forks
48
+        '/^.DS_Store$/', // OS/X custom folder settings
49 49
         '/^desktop.ini$/', // Windows custom folder settings
50
-        '/^Thumbs.db$/',   // Windows thumbnail cache
51
-        '/^.(.*).swpx$/',  // ViM temporary files
52
-        '/^.(.*).swx$/',   // ViM temporary files
53
-        '/^.(.*).swp$/',   // ViM temporary files
54
-        '/^\.dat(.*)$/',   // Smultron seems to create these
50
+        '/^Thumbs.db$/', // Windows thumbnail cache
51
+        '/^.(.*).swpx$/', // ViM temporary files
52
+        '/^.(.*).swx$/', // ViM temporary files
53
+        '/^.(.*).swp$/', // ViM temporary files
54
+        '/^\.dat(.*)$/', // Smultron seems to create these
55 55
         '/^~lock.(.*)#$/', // Windows 7 lockfiles
56 56
     ];
57 57
 
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
         }
544 544
 
545 545
         $this->hash = $new_hash;
546
-        $max = (int) (string) $this->_fs->getServer()->getMaxFileVersion();
546
+        $max = (int)(string)$this->_fs->getServer()->getMaxFileVersion();
547 547
         if (count($this->history) >= $max) {
548 548
             $del = key($this->history);
549 549
             $this->_logger->debug('history limit ['.$max.'] reached, remove oldest version ['.$del.'] from file ['.$this->_id.']', [
@@ -637,8 +637,8 @@  discard block
 block discarded – undo
637 637
     {
638 638
         assert(16 === strlen($data));
639 639
 
640
-        $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100
641
-        $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10
640
+        $data[6] = chr(ord($data[6])&0x0f|0x40); // set version to 0100
641
+        $data[8] = chr(ord($data[8])&0x3f|0x80); // set bits 6-7 to 10
642 642
 
643 643
         return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
644 644
     }
@@ -741,11 +741,11 @@  discard block
 block discarded – undo
741 741
 
742 742
             $tmp_file = $tmp.DIRECTORY_SEPARATOR.$this->guidv4(openssl_random_pseudo_bytes(16));
743 743
             $stream = fopen($tmp_file, 'w+');
744
-            $size = stream_copy_to_stream($file, $stream, ((int) $this->_fs->getServer()->getMaxFileSize() + 1));
744
+            $size = stream_copy_to_stream($file, $stream, ((int)$this->_fs->getServer()->getMaxFileSize() + 1));
745 745
             rewind($stream);
746 746
             fclose($file);
747 747
 
748
-            if ($size > (int) $this->_fs->getServer()->getMaxFileSize()) {
748
+            if ($size > (int)$this->_fs->getServer()->getMaxFileSize()) {
749 749
                 unlink($tmp_file);
750 750
 
751 751
                 throw new Exception\InsufficientStorage(
Please login to merge, or discard this patch.
src/app/Balloon.App.Elasticsearch/Elasticsearch.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
     /**
214 214
      * Get es client.
215 215
      *
216
-     * @return Elasticsearch
216
+     * @return Client
217 217
      */
218 218
     public function getEsClient(): Client
219 219
     {
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
      * Search.
231 231
      *
232 232
      * @param array $query
233
-     * @param array $share
233
+     * @param array $shares
234 234
      *
235 235
      * @return array
236 236
      */
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 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
         foreach ($config as $option => $value) {
94 94
             switch ($option) {
95 95
                 case 'server':
96
-                    $this->es_server = (array) $value;
96
+                    $this->es_server = (array)$value;
97 97
 
98 98
                 break;
99 99
                 case 'index':
100
-                    $this->es_index = (string) $value;
100
+                    $this->es_index = (string)$value;
101 101
 
102 102
                 break;
103 103
                 default:
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
             ],
148 148
         ]);
149 149
 
150
-        $user = (string) $this->user->getId();
150
+        $user = (string)$this->user->getId();
151 151
         foreach ($result['hits']['hits'] as $node) {
152 152
             $id = false;
153 153
 
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
                     $_node = $this->fs->findNodeById($id);
159 159
                     if ($_node->isDeleted() && (1 === $deleted || 2 === $deleted)
160 160
                      || !$_node->isDeleted() && (0 === $deleted || 2 === $deleted)) {
161
-                        if (!($_node->isShared() && !$_node->isOwnerRequest()) && !isset($list[(string) $_node->getId()])) {
162
-                            $list[(string) $_node->getId()] = $_node;
161
+                        if (!($_node->isShared() && !$_node->isOwnerRequest()) && !isset($list[(string)$_node->getId()])) {
162
+                            $list[(string)$_node->getId()] = $_node;
163 163
                         }
164 164
                     }
165 165
                 } catch (\Exception $e) {
@@ -239,8 +239,8 @@  discard block
 block discarded – undo
239 239
         $bool = $query['body']['query'];
240 240
 
241 241
         $filter1 = [];
242
-        $filter1['bool']['should'][]['term']['owner'] = (string) $this->user->getId();
243
-        $filter1['bool']['should'][]['term']['metadata.ref.owner'] = (string) $this->user->getId();
242
+        $filter1['bool']['should'][]['term']['owner'] = (string)$this->user->getId();
243
+        $filter1['bool']['should'][]['term']['metadata.ref.owner'] = (string)$this->user->getId();
244 244
 
245 245
         $share_filter = [
246 246
             'bool' => [
Please login to merge, or discard this patch.
src/app/Balloon.App.Elasticsearch/Job.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
     /**
76 76
      * Constructor.
77 77
      *
78
-     * @param Elasticsarch           $es
78
+     * @param Elasticsearch           $es
79 79
      * @param Storage                $storage
80 80
      * @param Server                 $server
81 81
      * @param NodeAttributeDecorator $decorator
Please login to merge, or discard this 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/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.