@@ -92,13 +92,13 @@ discard block |
||
92 | 92 | } |
93 | 93 | |
94 | 94 | return [ |
95 | - 'created' => function ($role) use ($attributes) { |
|
95 | + 'created' => function($role) use ($attributes) { |
|
96 | 96 | return $attributes['created']->toDateTime()->format('c'); |
97 | 97 | }, |
98 | - 'changed' => function ($role) use ($attributes) { |
|
98 | + 'changed' => function($role) use ($attributes) { |
|
99 | 99 | return $attributes['changed']->toDateTime()->format('c'); |
100 | 100 | }, |
101 | - 'deleted' => function ($role) use ($attributes) { |
|
101 | + 'deleted' => function($role) use ($attributes) { |
|
102 | 102 | if (false === $attributes['deleted']) { |
103 | 103 | return null; |
104 | 104 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | 'name' => (string) $attributes['username'], |
147 | 147 | 'admin' => (bool) $attributes['admin'], |
148 | 148 | 'namespace' => isset($attributes['namespace']) ? (string) $attributes['namespace'] : null, |
149 | - 'mail' => function ($role) use ($attributes, $user) { |
|
149 | + 'mail' => function($role) use ($attributes, $user) { |
|
150 | 150 | if (!isset($attributes['mail'])) { |
151 | 151 | return null; |
152 | 152 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | 'locale' => isset($attributes['locale']) ? (string) $attributes['locale'] : null, |
161 | 161 | 'hard_quota' => isset($attributes['hard_quota']) ? (int) $attributes['hard_quota'] : null, |
162 | 162 | 'soft_quota' => isset($attributes['soft_quota']) ? (int) $attributes['soft_quota'] : null, |
163 | - 'available' => function ($role) use (&$quota, $attributes, $user) { |
|
163 | + 'available' => function($role) use (&$quota, $attributes, $user) { |
|
164 | 164 | $quota === null ? $quota = $role->getQuotaUsage() : null; |
165 | 165 | if ($attributes['_id'] == $user->getId() || $user->isAdmin()) { |
166 | 166 | return $quota['available']; |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | |
169 | 169 | return null; |
170 | 170 | }, |
171 | - 'used' => function ($role) use (&$quota, $attributes, $user) { |
|
171 | + 'used' => function($role) use (&$quota, $attributes, $user) { |
|
172 | 172 | $quota === null ? $quota = $role->getQuotaUsage() : null; |
173 | 173 | if ($attributes['_id'] == $user->getId() || $user->isAdmin()) { |
174 | 174 | return $quota['used']; |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | |
349 | 349 | if ($node instanceof Collection && $recursive === true) { |
350 | 350 | $db = $this->db; |
351 | - $node->doRecursiveAction(function ($child) use ($db, $subscription) { |
|
351 | + $node->doRecursiveAction(function($child) use ($db, $subscription) { |
|
352 | 352 | $subscription['node'] = $child->getId(); |
353 | 353 | $db->subscription->replaceOne( |
354 | 354 | [ |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | |
375 | 375 | if ($node instanceof Collection && $recursive === true) { |
376 | 376 | $db = $this->db; |
377 | - $node->doRecursiveAction(function ($child) use ($db, $node_id, $user_id) { |
|
377 | + $node->doRecursiveAction(function($child) use ($db, $node_id, $user_id) { |
|
378 | 378 | $db->subscription->deleteOne([ |
379 | 379 | 'user' => $user_id, |
380 | 380 | 'node' => $node_id, |
@@ -93,6 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | /** |
95 | 95 | * Send notification. |
96 | + * @param User $sender |
|
96 | 97 | */ |
97 | 98 | public function notify(Iterable $receiver, ?User $sender, MessageInterface $message): bool |
98 | 99 | { |
@@ -180,6 +181,7 @@ discard block |
||
180 | 181 | |
181 | 182 | /** |
182 | 183 | * Add notification. |
184 | + * @param User $sender |
|
183 | 185 | */ |
184 | 186 | public function postNotification(User $receiver, ?User $sender, MessageInterface $message): ObjectId |
185 | 187 | { |
@@ -206,6 +208,8 @@ discard block |
||
206 | 208 | |
207 | 209 | /** |
208 | 210 | * Get notifications. |
211 | + * @param integer $offset |
|
212 | + * @param integer $limit |
|
209 | 213 | */ |
210 | 214 | public function getNotifications(User $user, ?int $offset = null, ?int $limit = null, ?int &$total = null): Iterable |
211 | 215 | { |
@@ -278,6 +282,7 @@ discard block |
||
278 | 282 | |
279 | 283 | /** |
280 | 284 | * Get subscription. |
285 | + * @return NodeInterface |
|
281 | 286 | */ |
282 | 287 | public function getSubscription(NodeInterface $node, User $user): ?array |
283 | 288 | { |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * |
118 | 118 | * @param string $id |
119 | 119 | * @param string $p |
120 | - * @param string $version |
|
120 | + * @param integer $version |
|
121 | 121 | */ |
122 | 122 | public function postRestore(int $version, ?string $id = null, ?string $p = null): Response |
123 | 123 | { |
@@ -406,6 +406,9 @@ discard block |
||
406 | 406 | |
407 | 407 | /** |
408 | 408 | * Get storage. |
409 | + * @param string|null $id |
|
410 | + * @param string|null $p |
|
411 | + * @param string|null $collection |
|
409 | 412 | */ |
410 | 413 | protected function getStorage($id, $p, $collection): StorageAdapterInterface |
411 | 414 | { |
@@ -90,6 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | /** |
92 | 92 | * Build a single dimension array with all nodes. |
93 | + * @param integer[] $cursor |
|
93 | 94 | */ |
94 | 95 | public function buildFeedFromCurrentState(?array $cursor = null, int $limit = 100, ?NodeInterface $node = null): array |
95 | 96 | { |
@@ -212,6 +213,8 @@ discard block |
||
212 | 213 | |
213 | 214 | /** |
214 | 215 | * Get delta feed with changes and cursor. |
216 | + * @param string $cursor |
|
217 | + * @param NodeInterface $node |
|
215 | 218 | */ |
216 | 219 | public function getDeltaFeed(?string $cursor = null, int $limit = 250, ?NodeInterface $node = null): array |
217 | 220 | { |
@@ -305,6 +308,7 @@ discard block |
||
305 | 308 | |
306 | 309 | /** |
307 | 310 | * Get event log. |
311 | + * @param NodeInterface $node |
|
308 | 312 | */ |
309 | 313 | public function getEventLog(int $limit = 100, int $skip = 0, ?NodeInterface $node = null, ?int &$total = null): Iterable |
310 | 314 | { |
@@ -523,6 +527,7 @@ discard block |
||
523 | 527 | |
524 | 528 | /** |
525 | 529 | * Get children with custom filter. |
530 | + * @param integer $limit |
|
526 | 531 | */ |
527 | 532 | protected function findNodeAttributesWithCustomFilter( |
528 | 533 | ?array $filter = null, |
@@ -246,7 +246,7 @@ |
||
246 | 246 | $delta[$share_member->getPath()] = $share_member; |
247 | 247 | } |
248 | 248 | } elseif ('undeleteCollection' === $log['operation'] || 'undeleteCollectionShare' === $log['operation']) { |
249 | - $log_node->doRecursiveAction(function ($sub_node) use (&$delta) { |
|
249 | + $log_node->doRecursiveAction(function($sub_node) use (&$delta) { |
|
250 | 250 | $delta[$sub_node->getPath()] = $sub_node; |
251 | 251 | }); |
252 | 252 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | 'message' => (string) $message['body'], |
99 | 99 | 'subject' => (string) $message['subject'], |
100 | 100 | 'locale' => (string) $message['locale'], |
101 | - 'sender' => function ($message) use ($server, $role_decorator) { |
|
101 | + 'sender' => function($message) use ($server, $role_decorator) { |
|
102 | 102 | if (!isset($message['sender'])) { |
103 | 103 | return null; |
104 | 104 | } |
@@ -109,10 +109,10 @@ discard block |
||
109 | 109 | return null; |
110 | 110 | } |
111 | 111 | }, |
112 | - 'created' => function ($message) { |
|
112 | + 'created' => function($message) { |
|
113 | 113 | return (new DateTime())->setTimestamp($message['_id']->getTimestamp())->format('c'); |
114 | 114 | }, |
115 | - 'node' => function ($message) use ($node_decorator, $fs) { |
|
115 | + 'node' => function($message) use ($node_decorator, $fs) { |
|
116 | 116 | if (isset($message['node'])) { |
117 | 117 | try { |
118 | 118 | return $node_decorator->decorate($fs->findNodeById($message['node']), ['id', 'name', '_links']); |
@@ -161,7 +161,7 @@ |
||
161 | 161 | $tpl = new Template($type); |
162 | 162 | |
163 | 163 | $attributes = compact('readonly', 'meta'); |
164 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
164 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
165 | 165 | |
166 | 166 | $stream = $tpl->get(); |
167 | 167 | $storage = $parent->getStorage(); |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | |
285 | 285 | if ($index === $chunks) { |
286 | 286 | $attributes = compact('changed', 'created', 'readonly', 'meta', 'acl'); |
287 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
287 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
288 | 288 | $attributes = $this->_verifyAttributes($attributes); |
289 | 289 | |
290 | 290 | return $this->_put($session, $id, $p, $collection, $name, $attributes, $conflict); |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | $storage = $this->getStorage($id, $p, $collection); |
400 | 400 | $session = $storage->storeTemporaryFile($input, $this->server->getIdentity()); |
401 | 401 | $attributes = compact('changed', 'created', 'readonly', 'meta', 'acl'); |
402 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
402 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
403 | 403 | $attributes = $this->_verifyAttributes($attributes); |
404 | 404 | |
405 | 405 | return $this->_put($session, $id, $p, $collection, $name, $attributes, $conflict); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * |
118 | 118 | * @param string $id |
119 | 119 | * @param string $p |
120 | - * @param string $version |
|
120 | + * @param integer $version |
|
121 | 121 | */ |
122 | 122 | public function postRestore(int $version, ?string $id = null, ?string $p = null): Response |
123 | 123 | { |
@@ -406,6 +406,9 @@ discard block |
||
406 | 406 | |
407 | 407 | /** |
408 | 408 | * Get storage. |
409 | + * @param string|null $id |
|
410 | + * @param string|null $p |
|
411 | + * @param string|null $collection |
|
409 | 412 | */ |
410 | 413 | protected function getStorage($id, $p, $collection): StorageAdapterInterface |
411 | 414 | { |
@@ -54,7 +54,7 @@ |
||
54 | 54 | */ |
55 | 55 | protected function setErrorHandler(LoggerInterface $logger): self |
56 | 56 | { |
57 | - set_error_handler(function ($severity, $message, $file, $line) use ($logger) { |
|
57 | + set_error_handler(function($severity, $message, $file, $line) use ($logger) { |
|
58 | 58 | $log = $message.' in '.$file.':'.$line; |
59 | 59 | |
60 | 60 | switch ($severity) { |
@@ -144,7 +144,7 @@ |
||
144 | 144 | protected function deleteNode(NodeInterface $node, Blackhole $dummy): bool |
145 | 145 | { |
146 | 146 | if ($node instanceof Collection) { |
147 | - $node->doRecursiveAction(function (NodeInterface $node) use ($dummy) { |
|
147 | + $node->doRecursiveAction(function(NodeInterface $node) use ($dummy) { |
|
148 | 148 | if ($node instanceof Collection) { |
149 | 149 | $node->setStorage($dummy); |
150 | 150 | } |