@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | * Load nodes by id. |
| 282 | 282 | * |
| 283 | 283 | * @param string $class Force check node type |
| 284 | - * @param bool $deleted |
|
| 284 | + * @param integer $deleted |
|
| 285 | 285 | */ |
| 286 | 286 | public function findNodesById(array $id = [], ?string $class = null, int $deleted = NodeInterface::DELETED_INCLUDE): Generator |
| 287 | 287 | { |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | * @param string $class Force set node type |
| 403 | 403 | * @param bool $multiple Allow $id to be an array |
| 404 | 404 | * @param bool $allow_root Allow instance of root collection |
| 405 | - * @param bool $deleted How to handle deleted node |
|
| 405 | + * @param integer $deleted How to handle deleted node |
|
| 406 | 406 | */ |
| 407 | 407 | public function getNode($id = null, $path = null, $class = null, bool $multiple = false, bool $allow_root = false, int $deleted = NodeInterface::DELETED_EXCLUDE): NodeInterface |
| 408 | 408 | { |
@@ -344,6 +344,7 @@ |
||
| 344 | 344 | |
| 345 | 345 | /** |
| 346 | 346 | * Get delta feed filter. |
| 347 | + * @param NodeInterface|null $node |
|
| 347 | 348 | */ |
| 348 | 349 | protected function buildDeltaFeedFilter(array $cursor, int $limit, ?NodeInterface $node): array |
| 349 | 350 | { |
@@ -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 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | 'username' => (string) $attributes['username'], |
| 145 | 145 | 'name' => (string) $attributes['username'], |
| 146 | 146 | 'namespace' => isset($attributes['namespace']) ? (string) $attributes['namespace'] : null, |
| 147 | - 'mail' => function ($role) use ($attributes, $user) { |
|
| 147 | + 'mail' => function($role) use ($attributes, $user) { |
|
| 148 | 148 | if (!isset($attributes['mail'])) { |
| 149 | 149 | return null; |
| 150 | 150 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | return null; |
| 157 | 157 | }, |
| 158 | 158 | 'locale' => isset($attributes['locale']) ? (string) $attributes['locale'] : null, |
| 159 | - 'quota' => function ($role) use ($attributes, $user) { |
|
| 159 | + 'quota' => function($role) use ($attributes, $user) { |
|
| 160 | 160 | if ($attributes['_id'] == $user->getId() || $user->isAdmin()) { |
| 161 | 161 | return $role->getQuotaUsage(); |
| 162 | 162 | } |
@@ -101,7 +101,7 @@ |
||
| 101 | 101 | break; |
| 102 | 102 | default: |
| 103 | 103 | throw new InvalidArgumentException('invalid option '.$option.' given'); |
| 104 | - } |
|
| 104 | + } |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | return $this; |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | */ |
| 220 | 220 | protected function decorate(string $template, array $context): string |
| 221 | 221 | { |
| 222 | - return preg_replace_callback('/\{([^}\.]*)\}/', function ($match) use ($context) { |
|
| 222 | + return preg_replace_callback('/\{([^}\.]*)\}/', function($match) use ($context) { |
|
| 223 | 223 | $key = $match[1]; |
| 224 | 224 | |
| 225 | 225 | if (isset($context[$key])) { |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | { |
| 236 | 236 | $decorator = $this->decorator; |
| 237 | 237 | |
| 238 | - return preg_replace_callback('/(\{node\.(([a-z]\.*)+)\})/', function ($match) use ($node, $decorator) { |
|
| 238 | + return preg_replace_callback('/(\{node\.(([a-z]\.*)+)\})/', function($match) use ($node, $decorator) { |
|
| 239 | 239 | $key = explode('.', $match[2]); |
| 240 | 240 | $key = array_shift($key); |
| 241 | 241 | $attrs = $decorator->decorate($node, [$key]); |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | { |
| 252 | 252 | $role_decorator = $this->role_decorator; |
| 253 | 253 | |
| 254 | - return preg_replace_callback('/(\{user\.(([a-z]\.*)+)\})/', function ($match) use ($user, $role_decorator) { |
|
| 254 | + return preg_replace_callback('/(\{user\.(([a-z]\.*)+)\})/', function($match) use ($user, $role_decorator) { |
|
| 255 | 255 | $key = explode('.', $match[2]); |
| 256 | 256 | $key = array_shift($key); |
| 257 | 257 | $attrs = $role_decorator->decorate($user, [$key]); |
@@ -114,10 +114,10 @@ |
||
| 114 | 114 | $body->setParts([$html, $plain]); |
| 115 | 115 | |
| 116 | 116 | $mail = (new Message()) |
| 117 | - ->setSubject($message->getSubject($receiver)) |
|
| 118 | - ->setBody($body) |
|
| 119 | - ->setTo($address) |
|
| 120 | - ->setEncoding('UTF-8'); |
|
| 117 | + ->setSubject($message->getSubject($receiver)) |
|
| 118 | + ->setBody($body) |
|
| 119 | + ->setTo($address) |
|
| 120 | + ->setEncoding('UTF-8'); |
|
| 121 | 121 | |
| 122 | 122 | $type = $mail->getHeaders()->get('Content-Type'); |
| 123 | 123 | $type->setType('multipart/alternative'); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | 'directory' => $node instanceof Collection, |
| 57 | 57 | 'meta' => $node->getMetaAttributes(), |
| 58 | 58 | 'size' => $node->getSize(), |
| 59 | - 'parent' => function ($node, $requested) use ($attributes) { |
|
| 59 | + 'parent' => function($node, $requested) use ($attributes) { |
|
| 60 | 60 | $parent = $node->getParent(); |
| 61 | 61 | |
| 62 | 62 | if (null === $parent || $parent->isRoot()) { |
@@ -69,14 +69,14 @@ discard block |
||
| 69 | 69 | 'shared' => (string) $attributes['shared'], |
| 70 | 70 | 'created' => $attributes['created']->toDateTime()->format('c'), |
| 71 | 71 | 'changed' => $attributes['changed']->toDateTime()->format('c'), |
| 72 | - 'deleted' => function ($node, $requested) use ($attributes) { |
|
| 72 | + 'deleted' => function($node, $requested) use ($attributes) { |
|
| 73 | 73 | if (!$attributes['deleted']) { |
| 74 | 74 | return null; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | return $attributes['deleted']->toDateTime()->format('c'); |
| 78 | 78 | }, |
| 79 | - 'destroy' => function ($node, $requested) use ($attributes) { |
|
| 79 | + 'destroy' => function($node, $requested) use ($attributes) { |
|
| 80 | 80 | if (!$attributes['destroy']) { |
| 81 | 81 | return null; |
| 82 | 82 | } |
@@ -65,13 +65,13 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | }); |
| 67 | 67 | |
| 68 | - $node_decorator_v2->addDecorator('sharelink_has_password', function ($node) use ($sharelink) { |
|
| 68 | + $node_decorator_v2->addDecorator('sharelink_has_password', function($node) use ($sharelink) { |
|
| 69 | 69 | $attributes = $sharelink->getSharelink($node); |
| 70 | 70 | |
| 71 | 71 | return isset($attributes['password']); |
| 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 | |
@@ -256,9 +256,9 @@ |
||
| 256 | 256 | $body->setParts([$html, $plain]); |
| 257 | 257 | |
| 258 | 258 | $mail = (new Message()) |
| 259 | - ->setSubject($message->getSubject()) |
|
| 260 | - ->setBody($body) |
|
| 261 | - ->setEncoding('UTF-8'); |
|
| 259 | + ->setSubject($message->getSubject()) |
|
| 260 | + ->setBody($body) |
|
| 261 | + ->setEncoding('UTF-8'); |
|
| 262 | 262 | |
| 263 | 263 | $type = $mail->getHeaders()->get('Content-Type'); |
| 264 | 264 | $type->setType('multipart/alternative'); |