@@ -171,7 +171,7 @@ |
||
171 | 171 | */ |
172 | 172 | protected function setExceptionHandler(): self |
173 | 173 | { |
174 | - set_exception_handler(function ($e) { |
|
174 | + set_exception_handler(function($e) { |
|
175 | 175 | $this->logger->emergency('uncaught exception: '.$e->getMessage(), [ |
176 | 176 | 'category' => get_class($this), |
177 | 177 | 'exception' => $e, |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | if ($this->auth->requireOne()) { |
87 | 87 | if (!($this->auth->getIdentity()->getAdapter() instanceof AuthNone)) { |
88 | - $this->auth->getIdentity()->getAttributeMap()->addMapper('binary', function ($value) { |
|
88 | + $this->auth->getIdentity()->getAttributeMap()->addMapper('binary', function($value) { |
|
89 | 89 | return new Binary($value, Binary::TYPE_GENERIC); |
90 | 90 | }); |
91 | 91 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | protected function setExceptionHandler(): self |
140 | 140 | { |
141 | - set_exception_handler(function ($e) { |
|
141 | + set_exception_handler(function($e) { |
|
142 | 142 | $this->logger->emergency('uncaught exception: '.$e->getMessage(), [ |
143 | 143 | 'category' => get_class($this), |
144 | 144 | 'exception' => $e, |
@@ -42,7 +42,7 @@ |
||
42 | 42 | */ |
43 | 43 | protected function setErrorHandler(): self |
44 | 44 | { |
45 | - set_error_handler(function ($severity, $message, $file, $line) { |
|
45 | + set_error_handler(function($severity, $message, $file, $line) { |
|
46 | 46 | $log = $message.' in '.$file.':'.$line; |
47 | 47 | |
48 | 48 | switch ($severity) { |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | |
405 | 405 | if ($node instanceof Collection && $recursive === true) { |
406 | 406 | $db = $this->db; |
407 | - $node->doRecursiveAction(function ($child) use ($db, $subscription) { |
|
407 | + $node->doRecursiveAction(function($child) use ($db, $subscription) { |
|
408 | 408 | $subscription['node_id'] = $child->getId(); |
409 | 409 | $db->subscription->replaceOne( |
410 | 410 | [ |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | |
431 | 431 | if ($node instanceof Collection && $recursive === true) { |
432 | 432 | $db = $this->db; |
433 | - $node->doRecursiveAction(function ($child) use ($db, $node_id, $user_id) { |
|
433 | + $node->doRecursiveAction(function($child) use ($db, $node_id, $user_id) { |
|
434 | 434 | $db->subscription->deleteOne([ |
435 | 435 | 'user' => $user_id, |
436 | 436 | 'node' => $node_id, |
@@ -194,6 +194,7 @@ discard block |
||
194 | 194 | |
195 | 195 | /** |
196 | 196 | * Add notification. |
197 | + * @param User $sender |
|
197 | 198 | */ |
198 | 199 | public function postNotification(User $receiver, ?User $sender, MessageInterface $message, array $context = []): ObjectId |
199 | 200 | { |
@@ -291,6 +292,7 @@ discard block |
||
291 | 292 | |
292 | 293 | /** |
293 | 294 | * Get subscription. |
295 | + * @return NodeInterface |
|
294 | 296 | */ |
295 | 297 | public function getSubscription(NodeInterface $node, User $user): ?array |
296 | 298 | { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | ->prependRoute(new Route('/api/v2/nodes|files|collections/subscription(/|\z)', v2\Subscription::class)) |
33 | 33 | ->prependRoute(new Route('/api/v2/nodes|files|collections/{id:#([0-9a-z]{24})#}/subscription(/|\z)', v2\Subscription::class)); |
34 | 34 | |
35 | - $decorator->addDecorator('subscription', function ($node) use ($notifier, $server) { |
|
35 | + $decorator->addDecorator('subscription', function($node) use ($notifier, $server) { |
|
36 | 36 | $subscription = $notifier->getSubscription($node, $server->getIdentity()); |
37 | 37 | if ($subscription === null) { |
38 | 38 | return false; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | return true; |
42 | 42 | }); |
43 | 43 | |
44 | - $decorator->addDecorator('subscription_exclude_me', function ($node) use ($notifier, $server) { |
|
44 | + $decorator->addDecorator('subscription_exclude_me', function($node) use ($notifier, $server) { |
|
45 | 45 | $subscription = $notifier->getSubscription($node, $server->getIdentity()); |
46 | 46 | if ($subscription === null) { |
47 | 47 | return false; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | return $subscription['exclude_me']; |
51 | 51 | }); |
52 | 52 | |
53 | - $decorator->addDecorator('subscription_recursive', function ($node) use ($notifier, $server) { |
|
53 | + $decorator->addDecorator('subscription_recursive', function($node) use ($notifier, $server) { |
|
54 | 54 | if (!($node instanceof Collection)) { |
55 | 55 | return null; |
56 | 56 | } |
@@ -82,7 +82,7 @@ |
||
82 | 82 | $node_decorator = $this->node_decorator; |
83 | 83 | $notifier = $this->notifier; |
84 | 84 | |
85 | - return $this->bulk($id, $p, function ($node) use ($node_decorator, $notifier, $subscribe, $exclude_me, $recursive) { |
|
85 | + return $this->bulk($id, $p, function($node) use ($node_decorator, $notifier, $subscribe, $exclude_me, $recursive) { |
|
86 | 86 | $notifier->subscribeNode($node, $subscribe, $exclude_me, $recursive); |
87 | 87 | |
88 | 88 | return [ |
@@ -102,7 +102,7 @@ |
||
102 | 102 | 'id' => (string) $message['_id'], |
103 | 103 | 'message' => (string) $message['body'], |
104 | 104 | 'subject' => (string) $message['subject'], |
105 | - 'sender' => function ($message) use ($server, $role_decorator) { |
|
105 | + 'sender' => function($message) use ($server, $role_decorator) { |
|
106 | 106 | if (!isset($message['sender'])) { |
107 | 107 | return null; |
108 | 108 | } |
@@ -64,7 +64,7 @@ |
||
64 | 64 | ->setHeader('Content-Type', 'application/octet-stream') |
65 | 65 | ->setHeader('Content-Transfer-Encoding', 'binary') |
66 | 66 | ->setOutputFormat(null) |
67 | - ->setBody(function () use ($url) { |
|
67 | + ->setBody(function() use ($url) { |
|
68 | 68 | $stream = fopen($url, 'r'); |
69 | 69 | while (!feof($stream)) { |
70 | 70 | echo fread($stream, 8192); |
@@ -34,7 +34,7 @@ |
||
34 | 34 | ->prependRoute(new Route('/api/v2/files/convert(/|\z)', Convert::class)) |
35 | 35 | ->prependRoute(new Route('/api/v2/files/{id:#([0-9a-z]{24})#}/convert(/|\z)', Convert::class)); |
36 | 36 | |
37 | - $node_decorator->addDecorator('master', function ($node) use ($convert_decorator, $converter) { |
|
37 | + $node_decorator->addDecorator('master', function($node) use ($convert_decorator, $converter) { |
|
38 | 38 | $master = $node->getAppAttribute('Balloon\\App\\Convert', 'master'); |
39 | 39 | if (null === $master) { |
40 | 40 | return null; |