@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | * @param string $class Force set node type |
215 | 215 | * @param bool $multiple Allow $id to be an array |
216 | 216 | * @param bool $allow_root Allow instance of root collection |
217 | - * @param bool $deleted How to handle deleted node |
|
217 | + * @param integer $deleted How to handle deleted node |
|
218 | 218 | * |
219 | 219 | * @return NodeInterface |
220 | 220 | */ |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | * @param string $id |
249 | 249 | * @param string $path |
250 | 250 | * @param string $class Force set node type |
251 | - * @param bool $deleted How to handle deleted node |
|
251 | + * @param integer $deleted How to handle deleted node |
|
252 | 252 | * |
253 | 253 | * @return Generator |
254 | 254 | */ |
@@ -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 |
@@ -180,9 +180,9 @@ discard block |
||
180 | 180 | $body = []; |
181 | 181 | foreach ($this->_getNodes($id, $p) as $node) { |
182 | 182 | try { |
183 | - $body[(string) $node->getId()] = $action->call($this, $node); |
|
183 | + $body[(string)$node->getId()] = $action->call($this, $node); |
|
184 | 184 | } catch (\Exception $e) { |
185 | - $body[(string) $node->getId()] = [ |
|
185 | + $body[(string)$node->getId()] = [ |
|
186 | 186 | 'code' => $e instanceof ExceptionInterface ? $e->getStatusCode() : 400, |
187 | 187 | 'data' => [ |
188 | 188 | 'error' => get_class($e), |
@@ -302,7 +302,6 @@ |
||
302 | 302 | * HTTP/1.1 200 OK |
303 | 303 | * |
304 | 304 | * @param string $id |
305 | - * @param array $attributes |
|
306 | 305 | * |
307 | 306 | * @return Response |
308 | 307 | */ |
@@ -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 |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | } |
271 | 271 | |
272 | 272 | $attributes = compact('namespace', 'optional'); |
273 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
273 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
274 | 274 | |
275 | 275 | $id = $this->server->addGroup($name, $member, $attributes); |
276 | 276 | $result = $this->decorator->decorate($this->server->getGroupById($id)); |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | public function patch(string $id, ?array $member = null, ?string $namespace = null, ?array $optional = null): Response |
310 | 310 | { |
311 | 311 | $attributes = compact('namespace', 'optional', 'name', 'member'); |
312 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
312 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
313 | 313 | |
314 | 314 | $group = $this->_getGroup($id, true)->setAttributes($attributes); |
315 | 315 | $result = $this->decorator->decorate($group); |
@@ -158,8 +158,6 @@ discard block |
||
158 | 158 | * "name": "peter.meier" |
159 | 159 | * } |
160 | 160 | * |
161 | - * @param string $id |
|
162 | - * @param string $uname |
|
163 | 161 | * |
164 | 162 | * @return Response |
165 | 163 | */ |
@@ -429,7 +427,6 @@ discard block |
||
429 | 427 | * |
430 | 428 | * @param string $uname |
431 | 429 | * @param string $id |
432 | - * @param array $attributes |
|
433 | 430 | * |
434 | 431 | * @return Response |
435 | 432 | */ |
@@ -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 |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | } |
389 | 389 | |
390 | 390 | $attributes = compact('password', 'soft_quota', 'hard_quota', 'avatar', 'mail', 'admin', 'namespace', 'optional'); |
391 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
391 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
392 | 392 | |
393 | 393 | if (isset($attributes['avatar'])) { |
394 | 394 | $attributes['avatar'] = new Binary(base64_decode($attributes['avatar']), Binary::TYPE_GENERIC); |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | public function patch(?string $id = null, ?string $uname = null, ?string $username = null, ?string $password = null, ?int $soft_quota = null, ?int $hard_quota = null, ?string $avatar = null, ?string $mail = null, ?bool $admin = false, ?string $namespace = null, ?array $optional = null): Response |
437 | 437 | { |
438 | 438 | $attributes = compact('username', 'password', 'soft_quota', 'hard_quota', 'avatar', 'mail', 'admin', 'namespace', 'optional'); |
439 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
439 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
440 | 440 | |
441 | 441 | if (isset($attributes['avatar'])) { |
442 | 442 | $attributes['avatar'] = new Binary(base64_decode($attributes['avatar']), Binary::TYPE_GENERIC); |
@@ -107,7 +107,7 @@ |
||
107 | 107 | * @param array $query |
108 | 108 | * @param array $attributes |
109 | 109 | * @param int $deleted |
110 | - * @param mixed $limit |
|
110 | + * @param integer $limit |
|
111 | 111 | * |
112 | 112 | * @return Response |
113 | 113 | */ |
@@ -19,7 +19,6 @@ |
||
19 | 19 | use Balloon\Filesystem\Node\NodeInterface; |
20 | 20 | use Balloon\Hook\AbstractHook; |
21 | 21 | use Balloon\Server; |
22 | -use Balloon\Server\User; |
|
23 | 22 | use InvalidArgumentException; |
24 | 23 | use MongoDB\BSON\UTCDateTime; |
25 | 24 | use Psr\Log\LoggerInterface; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * |
72 | 72 | * @param Database $db |
73 | 73 | * @param Server $server |
74 | - * @param LoggerInterace $logger |
|
74 | + * @param LoggerInterface $logger |
|
75 | 75 | * @param iterable $config |
76 | 76 | */ |
77 | 77 | public function __construct(Database $db, Server $server, LoggerInterface $logger, ?Iterable $config = null) |
@@ -116,9 +116,7 @@ discard block |
||
116 | 116 | * |
117 | 117 | * @param iterable $receiver |
118 | 118 | * @param User $sender |
119 | - * @param string $subject |
|
120 | - * @param string $body |
|
121 | - * @param array $context |
|
119 | + * @param string $context |
|
122 | 120 | * |
123 | 121 | * @return bool |
124 | 122 | */ |
@@ -226,10 +224,10 @@ discard block |
||
226 | 224 | /** |
227 | 225 | * Add notification. |
228 | 226 | * |
229 | - * @param array $receiver |
|
230 | - * @param User $user |
|
227 | + * @param User $receiver |
|
231 | 228 | * @param MessageInterface $message |
232 | 229 | * @param array $context |
230 | + * @param User $sender |
|
233 | 231 | * |
234 | 232 | * @return ObjectId |
235 | 233 | */ |
@@ -50,7 +50,6 @@ |
||
50 | 50 | * @param Router $router |
51 | 51 | * @param Hook $hook |
52 | 52 | * @param Share $sharelink |
53 | - * @param AttributeDecorator $decorator |
|
54 | 53 | * @param LoggerInterface $logger |
55 | 54 | */ |
56 | 55 | public function __construct(Router $router, Hook $hook, Share $sharelink, NodeAttributeDecorator $node_decorator_v2, NodeAttributeDecoratorv1 $node_decorator_v1, LoggerInterface $logger) |
@@ -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 |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | }); |
73 | 73 | |
74 | - $node_decorator_v2->addDecorator('sharelink_token', function ($node) use ($sharelink) { |
|
74 | + $node_decorator_v2->addDecorator('sharelink_token', function($node) use ($sharelink) { |
|
75 | 75 | $attributes = $sharelink->getSharelink($node); |
76 | 76 | |
77 | 77 | if (isset($attributes['token'])) { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | } |
80 | 80 | }); |
81 | 81 | |
82 | - $node_decorator_v2->addDecorator('sharelink_expire', function ($node) use ($sharelink) { |
|
82 | + $node_decorator_v2->addDecorator('sharelink_expire', function($node) use ($sharelink) { |
|
83 | 83 | $attributes = $sharelink->getSharelink($node); |
84 | 84 | |
85 | 85 | if (isset($attributes['expiration'])) { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | }); |
91 | 91 | |
92 | - $node_decorator_v1->addDecorator('sharelink', function ($node) use ($sharelink) { |
|
92 | + $node_decorator_v1->addDecorator('sharelink', function($node) use ($sharelink) { |
|
93 | 93 | return isset($sharelink->getSharelink($node)['token']); |
94 | 94 | }); |
95 | 95 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | if (isset($_GET['t']) && !empty($_GET['t'])) { |
108 | 108 | $token = $_GET['t']; |
109 | 109 | if (isset($_GET['download'])) { |
110 | - $download = (bool) $_GET['download']; |
|
110 | + $download = (bool)$_GET['download']; |
|
111 | 111 | } else { |
112 | 112 | $download = false; |
113 | 113 | } |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | /** |
182 | 182 | * Find raw node. |
183 | 183 | * |
184 | - * @param ObjectId $id |
|
184 | + * @param ObjectId|null $id |
|
185 | 185 | * |
186 | 186 | * @return array |
187 | 187 | */ |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | * |
303 | 303 | * @param array $id |
304 | 304 | * @param string $class Force check node type |
305 | - * @param bool $deleted |
|
305 | + * @param integer $deleted |
|
306 | 306 | * |
307 | 307 | * @return Generator |
308 | 308 | */ |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | * @param string $class Force set node type |
432 | 432 | * @param bool $multiple Allow $id to be an array |
433 | 433 | * @param bool $allow_root Allow instance of root collection |
434 | - * @param bool $deleted How to handle deleted node |
|
434 | + * @param integer $deleted How to handle deleted node |
|
435 | 435 | * |
436 | 436 | * @return NodeInterface |
437 | 437 | */ |
@@ -493,7 +493,6 @@ discard block |
||
493 | 493 | * @param array $filter |
494 | 494 | * @param int $offset |
495 | 495 | * @param int $limit |
496 | - * @param int $total |
|
497 | 496 | * |
498 | 497 | * @return Generator |
499 | 498 | */ |
@@ -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 |
@@ -187,8 +187,8 @@ discard block |
||
187 | 187 | */ |
188 | 188 | public function findRawNode(ObjectId $id): array |
189 | 189 | { |
190 | - if (isset($this->cache[(string) $id])) { |
|
191 | - return $this->cache[(string) $id]->getRawAttributes(); |
|
190 | + if (isset($this->cache[(string)$id])) { |
|
191 | + return $this->cache[(string)$id]->getRawAttributes(); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | $node = $this->db->storage->findOne(['_id' => $id]); |
@@ -213,8 +213,8 @@ discard block |
||
213 | 213 | */ |
214 | 214 | public function findNodeById($id, ?string $class = null, int $deleted = NodeInterface::DELETED_INCLUDE): NodeInterface |
215 | 215 | { |
216 | - if (isset($this->cache[(string) $id])) { |
|
217 | - return $this->cache[(string) $id]; |
|
216 | + if (isset($this->cache[(string)$id])) { |
|
217 | + return $this->cache[(string)$id]; |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | if (!is_string($id) && !($id instanceof ObjectId)) { |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | } |
622 | 622 | |
623 | 623 | if ($this->user !== null) { |
624 | - $this->cache[(string) $node['_id']] = $instance; |
|
624 | + $this->cache[(string)$node['_id']] = $instance; |
|
625 | 625 | } |
626 | 626 | |
627 | 627 | return $instance; |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | /** |
270 | 270 | * Get real id (reference). |
271 | 271 | * |
272 | - * @return ObjectId |
|
272 | + * @return ObjectId|null |
|
273 | 273 | */ |
274 | 274 | public function getRealId(): ?ObjectId |
275 | 275 | { |
@@ -298,7 +298,6 @@ discard block |
||
298 | 298 | /** |
299 | 299 | * Fetch children items of this collection. |
300 | 300 | * |
301 | - * @param string $node |
|
302 | 301 | * @param int $deleted |
303 | 302 | * @param array $filter |
304 | 303 | * @param mixed $name |
@@ -860,7 +859,7 @@ discard block |
||
860 | 859 | * @param string $name |
861 | 860 | * @param string $data |
862 | 861 | * |
863 | - * @return File |
|
862 | + * @return string |
|
864 | 863 | */ |
865 | 864 | public function createFile($name, $data = null): String |
866 | 865 | { |
@@ -885,7 +884,6 @@ discard block |
||
885 | 884 | * |
886 | 885 | * @param callable $callable |
887 | 886 | * @param int $deleted |
888 | - * @param bool $ignore_exception |
|
889 | 887 | * |
890 | 888 | * @return bool |
891 | 889 | */ |
@@ -16,7 +16,6 @@ |
||
16 | 16 | use Balloon\Filesystem\Acl\Exception\Forbidden as ForbiddenException; |
17 | 17 | use Balloon\Filesystem\Exception; |
18 | 18 | use Balloon\Hook; |
19 | -use Balloon\Server\User; |
|
20 | 19 | use Generator; |
21 | 20 | use MongoDB\BSON\ObjectId; |
22 | 21 | use MongoDB\BSON\Regex; |
@@ -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 |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | $this->deleted = new UTCDateTime(); |
373 | 373 | |
374 | 374 | if (!$this->isReference()) { |
375 | - $this->doRecursiveAction(function ($node) use ($recursion) { |
|
375 | + $this->doRecursiveAction(function($node) use ($recursion) { |
|
376 | 376 | $node->delete(false, $recursion, false); |
377 | 377 | }, NodeInterface::DELETED_EXCLUDE); |
378 | 378 | } |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | |
439 | 439 | $node = $this->_db->storage->findOne($find); |
440 | 440 | |
441 | - return (bool) $node; |
|
441 | + return (bool)$node; |
|
442 | 442 | } |
443 | 443 | |
444 | 444 | /** |
@@ -977,7 +977,7 @@ discard block |
||
977 | 977 | protected function _forceDelete(?string $recursion = null, bool $recursion_first = true): bool |
978 | 978 | { |
979 | 979 | if (!$this->isReference()) { |
980 | - $this->doRecursiveAction(function ($node) use ($recursion) { |
|
980 | + $this->doRecursiveAction(function($node) use ($recursion) { |
|
981 | 981 | $node->delete(true, $recursion, false); |
982 | 982 | }, NodeInterface::DELETED_INCLUDE); |
983 | 983 | } |