@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Balloon |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * @param bool $ignore_deleted |
184 | 184 | * @return void |
185 | 185 | */ |
186 | - public function __construct($user, Logger $logger, Filesystem $fs, bool $autocreate=false, bool $ignore_deleted=true) |
|
186 | + public function __construct($user, Logger $logger, Filesystem $fs, bool $autocreate = false, bool $ignore_deleted = true) |
|
187 | 187 | { |
188 | 188 | $this->fs = $fs; |
189 | 189 | $this->db = $fs->getDatabase(); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | ]); |
198 | 198 | |
199 | 199 | if ($attributes === false || $attributes === null) { |
200 | - throw new Exception('user with id ' . $user . ' does not exists'); |
|
200 | + throw new Exception('user with id '.$user.' does not exists'); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | $username = $user; |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | * @param string|array $attribute |
278 | 278 | * @return mixed |
279 | 279 | */ |
280 | - public function getAttribute($attribute=null) |
|
280 | + public function getAttribute($attribute = null) |
|
281 | 281 | { |
282 | 282 | $valid = [ |
283 | 283 | 'id', |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | * @param bool $string |
353 | 353 | * @return array |
354 | 354 | */ |
355 | - public function getShares(bool $string=false): array |
|
355 | + public function getShares(bool $string = false): array |
|
356 | 356 | { |
357 | 357 | $item = $this->db->storage->find([ |
358 | 358 | 'deleted' => false, |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | 'reference' => 1, |
364 | 364 | ]); |
365 | 365 | |
366 | - $found = []; |
|
366 | + $found = []; |
|
367 | 367 | |
368 | 368 | foreach ($item as $child) { |
369 | 369 | if (isset($child['reference']) && $child['reference'] instanceof ObjectID) { |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | * @param int $limit |
390 | 390 | * @return array |
391 | 391 | */ |
392 | - public function getNodeAttributeSummary($attributes=[], int $limit=25): array |
|
392 | + public function getNodeAttributeSummary($attributes = [], int $limit = 25): array |
|
393 | 393 | { |
394 | 394 | $mongodb = $this->db->storage; |
395 | 395 | |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | * @param int $limit |
428 | 428 | * @return array |
429 | 429 | */ |
430 | - protected function _getAttributeSummary(string $attribute, string $type='string', int $limit=25): array |
|
430 | + protected function _getAttributeSummary(string $attribute, string $type = 'string', int $limit = 25): array |
|
431 | 431 | { |
432 | 432 | $mongodb = $this->db->storage; |
433 | 433 | |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | '$and' => [ |
438 | 438 | ['owner' => $this->_id], |
439 | 439 | ['deleted' => false], |
440 | - [$attribute => ['$exists' => true] ] |
|
440 | + [$attribute => ['$exists' => true]] |
|
441 | 441 | ] |
442 | 442 | ] |
443 | 443 | ], |
@@ -703,7 +703,7 @@ discard block |
||
703 | 703 | * @param array $attributes |
704 | 704 | * @return bool |
705 | 705 | */ |
706 | - public function save(array $attributes=[]): bool |
|
706 | + public function save(array $attributes = []): bool |
|
707 | 707 | { |
708 | 708 | $set = []; |
709 | 709 | foreach ($attributes as $attr) { |
@@ -761,7 +761,7 @@ discard block |
||
761 | 761 | { |
762 | 762 | $quota = $this->getQuotaUsage(); |
763 | 763 | |
764 | - if (($quota['used']+$add) > $quota['hard_quota']) { |
|
764 | + if (($quota['used'] + $add) > $quota['hard_quota']) { |
|
765 | 765 | return false; |
766 | 766 | } |
767 | 767 | |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | * @param bool $force |
776 | 776 | * @return bool |
777 | 777 | */ |
778 | - public function delete(bool $force=false): bool |
|
778 | + public function delete(bool $force = false): bool |
|
779 | 779 | { |
780 | 780 | if ($force === false) { |
781 | 781 | $result_data = $this->fs->getRoot()->delete(); |
@@ -1,5 +1,5 @@ discard block |
||
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 |
||
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 |
@@ -1,5 +1,5 @@ discard block |
||
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 |
||
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; |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Balloon |
@@ -63,12 +63,12 @@ discard block |
||
63 | 63 | * @param string $p |
64 | 64 | * @return Response |
65 | 65 | */ |
66 | - public function post(?string $id=null, ?string $p=null): Response |
|
66 | + public function post(? string $id = null, ? string $p = null) : Response |
|
67 | 67 | { |
68 | 68 | $node = $this->fs->getNode($id, $p, 'File'); |
69 | 69 | $document = new Document($this->fs->getDatabase(), $node); |
70 | 70 | |
71 | - $session= new WopiSession($this->fs, $document, (int)$this->config->apps->Office->config->token_ttl); |
|
71 | + $session = new WopiSession($this->fs, $document, (int)$this->config->apps->Office->config->token_ttl); |
|
72 | 72 | $member = new Member($this->fs->getUser(), (int)$this->config->apps->Office->config->token_ttl); |
73 | 73 | $session->join($member) |
74 | 74 | ->store(); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function postJoin(string $id): Response |
109 | 109 | { |
110 | - $session= WopiSession::getSessionById($this->fs, $this->parseId($id)); |
|
110 | + $session = WopiSession::getSessionById($this->fs, $this->parseId($id)); |
|
111 | 111 | $member = new Member($this->fs->getUser(), (int)$this->config->apps->Office->config->token_ttl); |
112 | 112 | $session->join($member) |
113 | 113 | ->store(); |
@@ -1,5 +1,5 @@ discard block |
||
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 |
||
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 |
||
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); |
@@ -1,5 +1,5 @@ discard block |
||
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 |
||
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); |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Balloon |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Balloon |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Balloon |