Completed
Branch dev (0f747f)
by Raffael
17:07
created
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 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\Helper;
21 21
 use Balloon\Hook;
22 22
 use Balloon\Mime;
23
-use Balloon\Server\User;
24 23
 use MongoDB\BSON\UTCDateTime;
25 24
 use Psr\Log\LoggerInterface;
26 25
 
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 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
@@ -45,14 +45,14 @@  discard block
 block discarded – undo
45 45
      * @param array
46 46
      **/
47 47
     protected $temp_files = [
48
-        '/^\._(.*)$/',     // OS/X resource forks
49
-        '/^.DS_Store$/',   // OS/X custom folder settings
48
+        '/^\._(.*)$/', // OS/X resource forks
49
+        '/^.DS_Store$/', // OS/X custom folder settings
50 50
         '/^desktop.ini$/', // Windows custom folder settings
51
-        '/^Thumbs.db$/',   // Windows thumbnail cache
52
-        '/^.(.*).swpx$/',  // ViM temporary files
53
-        '/^.(.*).swx$/',   // ViM temporary files
54
-        '/^.(.*).swp$/',   // ViM temporary files
55
-        '/^\.dat(.*)$/',   // Smultron seems to create these
51
+        '/^Thumbs.db$/', // Windows thumbnail cache
52
+        '/^.(.*).swpx$/', // ViM temporary files
53
+        '/^.(.*).swx$/', // ViM temporary files
54
+        '/^.(.*).swp$/', // ViM temporary files
55
+        '/^\.dat(.*)$/', // Smultron seems to create these
56 56
         '/^~lock.(.*)#$/', // Windows 7 lockfiles
57 57
     ];
58 58
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
         $filtered = [];
198 198
 
199 199
         foreach ($history as $version) {
200
-            $v = (array) $version;
200
+            $v = (array)$version;
201 201
 
202 202
             $v['user'] = $this->_fs->getServer()->getUserById($version['user'])->getUsername();
203 203
             $v['changed'] = Helper::DateTimeToUnix($version['changed']);
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
         }
555 555
 
556 556
         $this->hash = $new_hash;
557
-        $max = (int) (string) $this->_fs->getServer()->getMaxFileVersion();
557
+        $max = (int)(string)$this->_fs->getServer()->getMaxFileVersion();
558 558
         if (count($this->history) >= $max) {
559 559
             $del = key($this->history);
560 560
             $this->_logger->debug('history limit ['.$max.'] reached, remove oldest version ['.$del.'] from file ['.$this->_id.']', [
@@ -648,8 +648,8 @@  discard block
 block discarded – undo
648 648
     {
649 649
         assert(16 === strlen($data));
650 650
 
651
-        $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100
652
-        $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10
651
+        $data[6] = chr(ord($data[6])&0x0f|0x40); // set version to 0100
652
+        $data[8] = chr(ord($data[8])&0x3f|0x80); // set bits 6-7 to 10
653 653
 
654 654
         return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
655 655
     }
@@ -752,11 +752,11 @@  discard block
 block discarded – undo
752 752
 
753 753
             $tmp_file = $tmp.DIRECTORY_SEPARATOR.$this->guidv4(openssl_random_pseudo_bytes(16));
754 754
             $stream = fopen($tmp_file, 'w+');
755
-            $size = stream_copy_to_stream($file, $stream, ((int) $this->_fs->getServer()->getMaxFileSize() + 1));
755
+            $size = stream_copy_to_stream($file, $stream, ((int)$this->_fs->getServer()->getMaxFileSize() + 1));
756 756
             rewind($stream);
757 757
             fclose($file);
758 758
 
759
-            if ($size > (int) $this->_fs->getServer()->getMaxFileSize()) {
759
+            if ($size > (int)$this->_fs->getServer()->getMaxFileSize()) {
760 760
                 unlink($tmp_file);
761 761
 
762 762
                 throw new Exception\InsufficientStorage(
Please login to merge, or discard this patch.
src/app/Balloon.App.Notification/Hook/NewShareAdded.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,6 @@
 block discarded – undo
14 14
 use Balloon\App\Notification\Exception;
15 15
 use Balloon\App\Notification\NodeMessage;
16 16
 use Balloon\App\Notification\Notifier;
17
-use Balloon\Async\Mail;
18 17
 use Balloon\Filesystem\Node\AttributeDecorator;
19 18
 use Balloon\Filesystem\Node\Collection;
20 19
 use Balloon\Filesystem\Node\NodeInterface;
Please login to merge, or discard this 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
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
             switch ($option) {
110 110
                 case 'body':
111 111
                 case 'subject':
112
-                    $this->{$option} = (string) $value;
112
+                    $this->{$option} = (string)$value;
113 113
 
114 114
                 break;
115 115
                 default:
@@ -148,13 +148,13 @@  discard block
 block discarded – undo
148 148
         foreach ($node->getAcl() as $rule) {
149 149
             if ('user' === $rule['type']) {
150 150
                 $user = $this->server->getUserById(new ObjectId($rule['id']));
151
-                if (!isset($receiver[(string) $user->getId()]) && $this->checkNotify($node, $user)) {
152
-                    $receiver[(string) $user->getId()] = $user;
151
+                if (!isset($receiver[(string)$user->getId()]) && $this->checkNotify($node, $user)) {
152
+                    $receiver[(string)$user->getId()] = $user;
153 153
                 }
154 154
             } elseif ('group' === $rule['type']) {
155 155
                 foreach ($this->server->getGroupById(new ObjectId($rule['id']))->getResolvedMember() as $user) {
156
-                    if (!isset($receiver[(string) $user->getId()]) && $this->checkNotify($node, $user)) {
157
-                        $receiver[(string) $user->getId()] = $user;
156
+                    if (!isset($receiver[(string)$user->getId()]) && $this->checkNotify($node, $user)) {
157
+                        $receiver[(string)$user->getId()] = $user;
158 158
                     }
159 159
                 }
160 160
             }
Please login to merge, or discard this patch.
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/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/Template.php 1 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.php 1 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/Exception.php 1 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/Document.php 1 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.