@@ -64,7 +64,7 @@ |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | $this->logger->info('found first time username ['.$username.'], auto-create user in mongodb user collection', [ |
| 67 | - 'category' => get_class($this) |
|
| 67 | + 'category' => get_class($this) |
|
| 68 | 68 | ]); |
| 69 | 69 | |
| 70 | 70 | $attributes = [ |
@@ -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 |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * @param Iterable $config |
| 33 | 33 | * @return PluginInterface |
| 34 | 34 | */ |
| 35 | - public function setOptions(?Iterable $config): PluginInterface |
|
| 35 | + public function setOptions(? Iterable $config) : PluginInterface |
|
| 36 | 36 | { |
| 37 | 37 | if ($config === null) { |
| 38 | 38 | return $this; |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * @param bool $autocreate |
| 58 | 58 | * @return void |
| 59 | 59 | */ |
| 60 | - public function preInstanceUser(User $user, string &$username, ?array &$attributes, bool $autocreate): void |
|
| 60 | + public function preInstanceUser(User $user, string&$username, ? array &$attributes, bool $autocreate) : void |
|
| 61 | 61 | { |
| 62 | 62 | if ($autocreate === false || $attributes !== null) { |
| 63 | 63 | return; |
@@ -84,19 +84,19 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | switch ($value['type']) { |
| 86 | 86 | case 'string': |
| 87 | - $attributes[$attr] = (string)$value['value']; |
|
| 87 | + $attributes[$attr] = (string)$value['value']; |
|
| 88 | 88 | break; |
| 89 | 89 | |
| 90 | 90 | case 'int': |
| 91 | - $attributes[$attr] = (int)$value['value']; |
|
| 91 | + $attributes[$attr] = (int)$value['value']; |
|
| 92 | 92 | break; |
| 93 | 93 | |
| 94 | 94 | case 'bool': |
| 95 | - $attributes[$attr] = (bool)$value['value']; |
|
| 95 | + $attributes[$attr] = (bool)$value['value']; |
|
| 96 | 96 | break; |
| 97 | 97 | |
| 98 | 98 | case 'binary': |
| 99 | - $attributes[$attr] = new Binary($value['value']); |
|
| 99 | + $attributes[$attr] = new Binary($value['value']); |
|
| 100 | 100 | break; |
| 101 | 101 | |
| 102 | 102 | default: |
@@ -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 |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * |
| 86 | 86 | * @var bool |
| 87 | 87 | */ |
| 88 | - protected $tls=false; |
|
| 88 | + protected $tls = false; |
|
| 89 | 89 | |
| 90 | 90 | |
| 91 | 91 | /** |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | * @param Logger $logger |
| 104 | 104 | * @return resource |
| 105 | 105 | */ |
| 106 | - public function __construct(?Iterable $config, Logger $logger) |
|
| 106 | + public function __construct(? Iterable $config, Logger $logger) |
|
| 107 | 107 | { |
| 108 | 108 | $this->setOptions($config); |
| 109 | 109 | $this->logger = $logger; |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * @param Iterable $config |
| 152 | 152 | * @return Ldap |
| 153 | 153 | */ |
| 154 | - public function setOptions(?Iterable $config): Ldap |
|
| 154 | + public function setOptions(? Iterable $config) : Ldap |
|
| 155 | 155 | { |
| 156 | 156 | if ($config === null) { |
| 157 | 157 | return $this; |
@@ -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 |
@@ -32,9 +32,9 @@ discard block |
||
| 32 | 32 | * @param Iterable $config |
| 33 | 33 | * @return void |
| 34 | 34 | */ |
| 35 | - public function __construct(Logger $logger, ?Iterable $config) |
|
| 35 | + public function __construct(Logger $logger, ? Iterable $config) |
|
| 36 | 36 | { |
| 37 | - $this->logger = $logger; |
|
| 37 | + $this->logger = $logger; |
|
| 38 | 38 | $this->setOptions($config); |
| 39 | 39 | } |
| 40 | 40 | } |
@@ -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 |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $this->logger = $logger; |
| 108 | 108 | $this->fs = $fs; |
| 109 | 109 | $this->db = $fs->getDatabase(); |
| 110 | - $this->pluginmgr= $fs->getPlugin(); |
|
| 110 | + $this->pluginmgr = $fs->getPlugin(); |
|
| 111 | 111 | $this->queuemgr = $fs->getQueue(); |
| 112 | 112 | $this->auth = $auth; |
| 113 | 113 | |
@@ -458,8 +458,8 @@ |
||
| 458 | 458 | |
| 459 | 459 | $ops[] = [ |
| 460 | 460 | '$sort' => [ |
| 461 | - "sum" => -1, |
|
| 462 | - "_id" => 1 |
|
| 461 | + "sum" => -1, |
|
| 462 | + "_id" => 1 |
|
| 463 | 463 | ], |
| 464 | 464 | ]; |
| 465 | 465 | |
@@ -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 |
@@ -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(); |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | protected function getTemplate(): string |
| 67 | 67 | { |
| 68 | 68 | return dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'assets' |
| 69 | - .DIRECTORY_SEPARATOR.'template.'.$this->type; |
|
| 69 | + .DIRECTORY_SEPARATOR.'template.'.$this->type; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | |
@@ -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 |