Completed
Branch master (1995c1)
by Raffael
08:57
created
src/app/Office/src/lib/Plugin/Office.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -11,8 +11,6 @@
 block discarded – undo
11 11
 
12 12
 namespace Balloon\App\Office\Plugin;
13 13
 
14
-use Balloon\Exception;
15
-use Balloon\Logger;
16 14
 use Balloon\Config;
17 15
 use Balloon\Plugin\AbstractPlugin;
18 16
 use Balloon\Auth\Adapter\None as AuthNone;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Balloon
Please login to merge, or discard this patch.
src/app/Office/src/lib/Rest/v1/Document.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,6 @@
 block discarded – undo
11 11
 
12 12
 namespace Balloon\App\Office\Rest\v1;
13 13
 
14
-use Balloon\Exception;
15 14
 use Balloon\Controller;
16 15
 use Balloon\App\Office\Document as OfficeDoc;
17 16
 use Balloon\App\Office\Template;
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
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      * @param   string $p
47 47
      * @return  Response
48 48
      */
49
-    public function get(?string $id=null, ?string $p=null): Response
49
+    public function get(? string $id = null, ? string $p = null) : Response
50 50
     {
51 51
         $node     = $this->fs->getNode($id, $p, 'File');
52 52
         $document = new OfficeDoc($this->fs->getDatabase(), $node);
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
      * @param   int $conflict
119 119
      * @return  Response
120 120
      */
121
-    public function put(string $name, string $type, ?string $collection=null, array $attributes=[], int $conflict=0): Response
121
+    public function put(string $name, string $type, ? string $collection = null, array $attributes = [], int $conflict = 0) : Response
122 122
     {
123 123
         $parent = $this->fs->getNode($collection, null, 'Collection', false, true);
124 124
         $tpl    = new Template($type);
Please login to merge, or discard this patch.
src/app/Office/src/lib/Rest/v1/Wopi/Document.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,6 @@
 block discarded – undo
24 24
      * Get by access token
25 25
      *
26 26
      * @param  string $id
27
-     * @param  string $access_token
28 27
      * @return Session
29 28
      */
30 29
     protected function parseId(string $id): ObjectId
Please login to merge, or discard this 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
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
     public function getContents(string $id, string $access_token): void
127 127
     {
128 128
         $session = Session::getByAccessToken($this->fs, $this->parseId($id), $access_token);
129
-        $stream =  $session->getDocument()->get();
129
+        $stream = $session->getDocument()->get();
130 130
 
131 131
         while (!feof($stream)) {
132 132
             echo fread($stream, 8192);
Please login to merge, or discard this patch.
src/app/Office/src/lib/Session.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
      * @param   Document $document
68 68
      * @param   int $ttl
69 69
      * @param   array $session
70
-     * @return  void
70
+     * @return  Member
71 71
      */
72 72
     public function __construct(Filesystem $fs, Document $document, int $ttl=3600, $session=[])
73 73
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,6 @@
 block discarded – undo
11 11
 
12 12
 namespace Balloon\App\Office;
13 13
 
14
-use Balloon\Config;
15 14
 use Balloon\User;
16 15
 use Balloon\Filesystem;
17 16
 use \MongoDB\BSON\ObjectId;
Please login to merge, or discard this 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
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      * @param   array $session
70 70
      * @return  void
71 71
      */
72
-    public function __construct(Filesystem $fs, Document $document, int $ttl=3600, $session=[])
72
+    public function __construct(Filesystem $fs, Document $document, int $ttl = 3600, $session = [])
73 73
     {
74 74
         $this->user = $fs->getUser();
75 75
         $this->fs   = $fs;
Please login to merge, or discard this patch.
src/app/Office/src/lib/Session/Member.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
      * @param   User $user
61 61
      * @param   int $ttl
62 62
      * @param   Session $session
63
-     * @return  void
63
+     * @return  Member
64 64
      */
65 65
     public function __construct(User $user, $ttl=3600, ?Session $session=null)
66 66
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,6 @@
 block discarded – undo
11 11
 
12 12
 namespace Balloon\App\Office\Session;
13 13
 
14
-use Balloon\Config;
15 14
 use Balloon\User;
16 15
 use Balloon\Logger;
17 16
 use Balloon\Filesystem;
Please login to merge, or discard this 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
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      * @param   Session $session
63 63
      * @return  void
64 64
      */
65
-    public function __construct(User $user, $ttl=3600, ?Session $session=null)
65
+    public function __construct(User $user, $ttl = 3600, ? Session $session = null)
66 66
     {
67 67
         $this->user = $user;
68 68
 
Please login to merge, or discard this patch.
src/lib/Balloon/App/AppInterface.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,6 @@
 block discarded – undo
17 17
 use Balloon\Auth;
18 18
 use Balloon\Filesystem;
19 19
 use Balloon\Config;
20
-use Balloon\Queue;
21
-use Balloon\Plugin;
22 20
 
23 21
 interface AppInterface
24 22
 {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Balloon
Please login to merge, or discard this patch.
src/lib/Balloon/App/Share.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\Exception;
15 15
 use Balloon\Config;
16 16
 use Balloon\App;
17
-use Balloon\Filesystem;
18 17
 use Balloon\Filesystem\Node\Collection;
19 18
 use Balloon\Http\Response;
20 19
 use Balloon\Http\Router\Route;
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
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     public function start()
55 55
     {
56 56
         if (isset($_GET['t']) && !empty($_GET['t'])) {
57
-            $token    = $_GET['t'];
57
+            $token = $_GET['t'];
58 58
             if (isset($_GET['download'])) {
59 59
                 $download = (bool)$_GET['download'];
60 60
             } else {
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
                 }
92 92
 
93 93
                 if ($download === true || preg_match('#html#', $mime)) {
94
-                    header('Content-Disposition: attachment; filename*=UTF-8\'\'' .rawurlencode($name));
94
+                    header('Content-Disposition: attachment; filename*=UTF-8\'\''.rawurlencode($name));
95 95
                     header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
96 96
                     header('Content-Type: application/octet-stream');
97 97
                     header('Content-Length: '.$node->getSize());
Please login to merge, or discard this patch.
src/lib/Balloon/App/Webdav.php 2 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -11,11 +11,8 @@
 block discarded – undo
11 11
 
12 12
 namespace Balloon\App;
13 13
 
14
-use Balloon\Exception;
15 14
 use Balloon\App;
16
-use Balloon\Filesystem;
17 15
 use Balloon\Auth;
18
-use Balloon\User;
19 16
 use \Sabre\DAV;
20 17
 use Balloon\Http\Router\Route;
21 18
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Balloon
Please login to merge, or discard this patch.
src/lib/Balloon/Auth.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     /**
63 63
      * Authenticate
64 64
      *
65
-     * @param   array|AdapterInterface|Config $adapters
65
+     * @param   Config $adapters
66 66
      * @return  bool
67 67
      */
68 68
     public function requireOne($adapters): bool
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
     /**
291 291
      * Get attribute sync cache
292 292
      *
293
-     * @return array
293
+     * @return integer
294 294
      */
295 295
     public function getAttributeSyncCache(): int
296 296
     {
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         }
123 123
         
124 124
         $this->logger->warning("all authentication adapter have failed", [
125
-           'category' => get_class($this)
125
+            'category' => get_class($this)
126 126
         ]);
127 127
 
128 128
         $this->plugin->run('invalidAuthentication', [$adapters]);
@@ -251,8 +251,8 @@  discard block
 block discarded – undo
251 251
                 switch ($value['type']) {
252 252
                     case 'array':
253 253
                          $arr =  (array)$data[$value['attr']];
254
-                          unset($arr['count']);
255
-                          $attrs[$attr] = $arr;
254
+                            unset($arr['count']);
255
+                            $attrs[$attr] = $arr;
256 256
                     break;
257 257
                         
258 258
                     case 'string':
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 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
@@ -250,25 +250,25 @@  discard block
 block discarded – undo
250 250
 
251 251
                 switch ($value['type']) {
252 252
                     case 'array':
253
-                         $arr =  (array)$data[$value['attr']];
253
+                         $arr = (array)$data[$value['attr']];
254 254
                           unset($arr['count']);
255 255
                           $attrs[$attr] = $arr;
256 256
                     break;
257 257
                         
258 258
                     case 'string':
259
-                         $attrs[$attr]  = (string)$store;
259
+                         $attrs[$attr] = (string)$store;
260 260
                     break;
261 261
                                             
262 262
                     case 'int':
263
-                         $attrs[$attr]  = (int)$store;
263
+                         $attrs[$attr] = (int)$store;
264 264
                     break;
265 265
                                             
266 266
                     case 'bool':
267
-                         $attrs[$attr]  = (bool)$store;
267
+                         $attrs[$attr] = (bool)$store;
268 268
                     break;
269 269
                     
270 270
                     case 'binary':
271
-                         $attrs[$attr]  = new Binary($store, Binary::TYPE_GENERIC);
271
+                         $attrs[$attr] = new Binary($store, Binary::TYPE_GENERIC);
272 272
                     break;
273 273
                     
274 274
                     default:
Please login to merge, or discard this patch.