@@ -79,7 +79,6 @@ |
||
| 79 | 79 | /** |
| 80 | 80 | * Constructor. |
| 81 | 81 | * |
| 82 | - * @param Database $db |
|
| 83 | 82 | * @param LoggerInterface $logger |
| 84 | 83 | */ |
| 85 | 84 | public function __construct(SocketFactory $factory, LoggerInterface $logger, ?Iterable $config = null) |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * balloon |
@@ -97,22 +97,22 @@ discard block |
||
| 97 | 97 | foreach ($config as $option => $value) { |
| 98 | 98 | switch ($option) { |
| 99 | 99 | case 'socket': |
| 100 | - $this->socket = (string) $value; |
|
| 100 | + $this->socket = (string)$value; |
|
| 101 | 101 | |
| 102 | 102 | break; |
| 103 | 103 | case 'max_stream_size': |
| 104 | - $this->max_stream_size = (int) $value; |
|
| 104 | + $this->max_stream_size = (int)$value; |
|
| 105 | 105 | |
| 106 | 106 | break; |
| 107 | 107 | case 'aggressiveness': |
| 108 | - if ((int) $value > 3 || (int) $value < 0) { |
|
| 109 | - throw new Exception('invalid config value ['.(int) $value.'] for aggressiveness'); |
|
| 108 | + if ((int)$value > 3 || (int)$value < 0) { |
|
| 109 | + throw new Exception('invalid config value ['.(int)$value.'] for aggressiveness'); |
|
| 110 | 110 | } |
| 111 | - $this->aggressiveness = (int) $value; |
|
| 111 | + $this->aggressiveness = (int)$value; |
|
| 112 | 112 | |
| 113 | 113 | break; |
| 114 | 114 | case 'timeout': |
| 115 | - $this->timeout = (int) $value; |
|
| 115 | + $this->timeout = (int)$value; |
|
| 116 | 116 | |
| 117 | 117 | break; |
| 118 | 118 | break; |
@@ -20,7 +20,6 @@ |
||
| 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 |
@@ -1,6 +1,6 @@ discard block |
||
| 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 |
||
| 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 | ]; |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | |
| 171 | 171 | return (new Response())->setCode(201)->setBody([ |
| 172 | 172 | 'code' => 201, |
| 173 | - 'data' => (string) $result->getId(), |
|
| 173 | + 'data' => (string)$result->getId(), |
|
| 174 | 174 | ]); |
| 175 | 175 | } |
| 176 | 176 | } |
@@ -151,7 +151,6 @@ |
||
| 151 | 151 | * Get by access token. |
| 152 | 152 | * |
| 153 | 153 | * @param string $id |
| 154 | - * @param string $access_token |
|
| 155 | 154 | * |
| 156 | 155 | * @return Session |
| 157 | 156 | */ |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * balloon |
@@ -148,7 +148,7 @@ |
||
| 148 | 148 | * @param ObjectId $session_id |
| 149 | 149 | * @param string $access_token |
| 150 | 150 | * |
| 151 | - * @return Session |
|
| 151 | + * @return Session|null |
|
| 152 | 152 | */ |
| 153 | 153 | public static function getByAccessToken(Server $server, ObjectId $session_id, string $access_token): self |
| 154 | 154 | { |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * balloon |
@@ -35,7 +35,6 @@ |
||
| 35 | 35 | /** |
| 36 | 36 | * Constructor. |
| 37 | 37 | * |
| 38 | - * @param App $app |
|
| 39 | 38 | * @param Server $server |
| 40 | 39 | */ |
| 41 | 40 | public function __construct(PreviewCreator $preview, Server $server) |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * balloon |
@@ -31,8 +31,6 @@ |
||
| 31 | 31 | /** |
| 32 | 32 | * Constructor. |
| 33 | 33 | * |
| 34 | - * @param Router $router |
|
| 35 | - * @param Hook $hook |
|
| 36 | 34 | */ |
| 37 | 35 | public function __construct(Database $db, LoggerInterface $logger, Converter $converter) |
| 38 | 36 | { |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * balloon |
@@ -32,8 +32,7 @@ |
||
| 32 | 32 | * Create result. |
| 33 | 33 | * |
| 34 | 34 | * @param string $path |
| 35 | - * @param resource $stream |
|
| 36 | - * @param null|mixed $resource |
|
| 35 | + * @param resource $resource |
|
| 37 | 36 | */ |
| 38 | 37 | public function __construct(string $path, $resource = null) |
| 39 | 38 | { |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * balloon |
@@ -29,7 +29,6 @@ |
||
| 29 | 29 | /** |
| 30 | 30 | * Delete file. |
| 31 | 31 | * |
| 32 | - * @param string $id |
|
| 33 | 32 | * @param array $attributes |
| 34 | 33 | * |
| 35 | 34 | * @return bool |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * balloon |
@@ -173,6 +173,7 @@ discard block |
||
| 173 | 173 | /** |
| 174 | 174 | * Filesystem factory. |
| 175 | 175 | * |
| 176 | + * @param User $user |
|
| 176 | 177 | * @return Filesystem |
| 177 | 178 | */ |
| 178 | 179 | public function getFilesystem(?User $user = null): Filesystem |
@@ -376,7 +377,7 @@ discard block |
||
| 376 | 377 | * |
| 377 | 378 | * @param string $id |
| 378 | 379 | * |
| 379 | - * @return User |
|
| 380 | + * @return Group |
|
| 380 | 381 | */ |
| 381 | 382 | public function getGroupById(ObjectId $id): Group |
| 382 | 383 | { |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | |
| 485 | 485 | $this->identity = $user; |
| 486 | 486 | $user->updateIdentity($identity) |
| 487 | - ->updateShares(); |
|
| 487 | + ->updateShares(); |
|
| 488 | 488 | $this->hook->run('postServerIdentity', [$user]); |
| 489 | 489 | |
| 490 | 490 | return true; |
@@ -572,7 +572,7 @@ discard block |
||
| 572 | 572 | public function getGroupByName(string $name): Group |
| 573 | 573 | { |
| 574 | 574 | $attributes = $this->db->group->findOne([ |
| 575 | - 'name' => $name, |
|
| 575 | + 'name' => $name, |
|
| 576 | 576 | ]); |
| 577 | 577 | |
| 578 | 578 | if (null === $attributes) { |
@@ -592,7 +592,7 @@ discard block |
||
| 592 | 592 | public function getGroupById(ObjectId $id): Group |
| 593 | 593 | { |
| 594 | 594 | $attributes = $this->db->group->findOne([ |
| 595 | - '_id' => $id, |
|
| 595 | + '_id' => $id, |
|
| 596 | 596 | ]); |
| 597 | 597 | |
| 598 | 598 | if (null === $attributes) { |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * balloon |
@@ -151,13 +151,13 @@ discard block |
||
| 151 | 151 | case 'temp_dir': |
| 152 | 152 | case 'password_policy': |
| 153 | 153 | case 'server_url': |
| 154 | - $this->{$name} = (string) $value; |
|
| 154 | + $this->{$name} = (string)$value; |
|
| 155 | 155 | |
| 156 | 156 | break; |
| 157 | 157 | case 'max_file_version': |
| 158 | 158 | case 'max_file_size': |
| 159 | 159 | case 'password_hash': |
| 160 | - $this->{$name} = (int) $value; |
|
| 160 | + $this->{$name} = (int)$value; |
|
| 161 | 161 | |
| 162 | 162 | break; |
| 163 | 163 | default: |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | |
| 337 | 337 | break; |
| 338 | 338 | case 'admin': |
| 339 | - $value = (bool) $value; |
|
| 339 | + $value = (bool)$value; |
|
| 340 | 340 | |
| 341 | 341 | break; |
| 342 | 342 | case 'namespace': |