@@ -89,6 +89,8 @@ |
||
89 | 89 | |
90 | 90 | /** |
91 | 91 | * Get slaves. |
92 | + * @param integer $offset |
|
93 | + * @param integer $limit |
|
92 | 94 | */ |
93 | 95 | public function getSlaves(File $node, array $query = [], ?int $offset = null, ?int $limit = null, ?int &$total = null): iterable |
94 | 96 | { |
@@ -12,7 +12,6 @@ |
||
12 | 12 | namespace Balloon\Migration\Delta; |
13 | 13 | |
14 | 14 | use MongoDB\Database; |
15 | -use MongoDB\Driver\Exception\CommandException; |
|
16 | 15 | use MongoDB\Driver\Exception\RuntimeException; |
17 | 16 | |
18 | 17 | class CreateUniqueUserMailIndex implements DeltaInterface |
@@ -85,6 +85,6 @@ |
||
85 | 85 | protected function getTemplate(): string |
86 | 86 | { |
87 | 87 | return __DIR__.DIRECTORY_SEPARATOR.'assets' |
88 | - .DIRECTORY_SEPARATOR.'template.'.$this->type; |
|
88 | + .DIRECTORY_SEPARATOR.'template.'.$this->type; |
|
89 | 89 | } |
90 | 90 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | ->prependRoute(new Route('/api/v2/files/preview(/|\z)', v2\Preview::class)) |
32 | 32 | ->prependRoute(new Route('/api/v2/files/{id:#([0-9a-z]{24})#}/preview(/|\z)', v2\Preview::class)); |
33 | 33 | |
34 | - $decorator->addDecorator('preview', function ($node) { |
|
34 | + $decorator->addDecorator('preview', function($node) { |
|
35 | 35 | if ($node instanceof Collection) { |
36 | 36 | return null; |
37 | 37 | } |
@@ -62,10 +62,10 @@ |
||
62 | 62 | |
63 | 63 | // Public Key Credential Request Options |
64 | 64 | $key = new PublicKeyCredentialRequestOptions( |
65 | - random_bytes(32), // Challenge |
|
66 | - 60000, // Timeout |
|
67 | - $domain, // Relying Party ID |
|
68 | - $registeredPublicKeyCredentialDescriptors, // Registered PublicKeyCredentialDescriptor classes |
|
65 | + random_bytes(32), // Challenge |
|
66 | + 60000, // Timeout |
|
67 | + $domain, // Relying Party ID |
|
68 | + $registeredPublicKeyCredentialDescriptors, // Registered PublicKeyCredentialDescriptor classes |
|
69 | 69 | PublicKeyCredentialRequestOptions::USER_VERIFICATION_REQUIREMENT_PREFERRED, // User verification requirement |
70 | 70 | $this->auth_extensions |
71 | 71 | ); |
@@ -97,13 +97,13 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | return [ |
100 | - 'created' => function ($role) use ($attributes) { |
|
100 | + 'created' => function($role) use ($attributes) { |
|
101 | 101 | return $attributes['created']->toDateTime()->format('c'); |
102 | 102 | }, |
103 | - 'changed' => function ($role) use ($attributes) { |
|
103 | + 'changed' => function($role) use ($attributes) { |
|
104 | 104 | return $attributes['changed']->toDateTime()->format('c'); |
105 | 105 | }, |
106 | - 'deleted' => function ($role) use ($attributes) { |
|
106 | + 'deleted' => function($role) use ($attributes) { |
|
107 | 107 | if (false === $attributes['deleted']) { |
108 | 108 | return null; |
109 | 109 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | 'id' => (string) $attributes['_id'], |
127 | 127 | 'name' => $attributes['name'], |
128 | 128 | 'namespace' => isset($attributes['namespace']) ? (string) $attributes['namespace'] : null, |
129 | - 'member' => array_map(function ($member) { return (string) $member; }, $attributes['member']), |
|
129 | + 'member' => array_map(function($member) { return (string) $member; }, $attributes['member']), |
|
130 | 130 | ]; |
131 | 131 | } |
132 | 132 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | 'name' => (string) $attributes['username'], |
149 | 149 | 'admin' => (bool) $attributes['admin'], |
150 | 150 | 'namespace' => isset($attributes['namespace']) ? (string) $attributes['namespace'] : null, |
151 | - 'mail' => function ($role) use ($attributes, $user) { |
|
151 | + 'mail' => function($role) use ($attributes, $user) { |
|
152 | 152 | if (!isset($attributes['mail'])) { |
153 | 153 | return null; |
154 | 154 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | 'locale' => isset($attributes['locale']) ? (string) $attributes['locale'] : null, |
163 | 163 | 'hard_quota' => isset($attributes['hard_quota']) ? (int) $attributes['hard_quota'] : null, |
164 | 164 | 'soft_quota' => isset($attributes['soft_quota']) ? (int) $attributes['soft_quota'] : null, |
165 | - 'available' => function ($role) use (&$quota, $attributes, $user) { |
|
165 | + 'available' => function($role) use (&$quota, $attributes, $user) { |
|
166 | 166 | $quota === null ? $quota = $role->getQuotaUsage() : null; |
167 | 167 | if ($attributes['_id'] == $user->getId() || $user->isAdmin()) { |
168 | 168 | return $quota['available']; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | return null; |
172 | 172 | }, |
173 | - 'used' => function ($role) use (&$quota, $attributes, $user) { |
|
173 | + 'used' => function($role) use (&$quota, $attributes, $user) { |
|
174 | 174 | $quota === null ? $quota = $role->getQuotaUsage() : null; |
175 | 175 | if ($attributes['_id'] == $user->getId() || $user->isAdmin()) { |
176 | 176 | return $quota['used']; |
@@ -178,14 +178,14 @@ discard block |
||
178 | 178 | |
179 | 179 | return null; |
180 | 180 | }, |
181 | - 'has_password' => function ($role) use ($user, $attributes) { |
|
181 | + 'has_password' => function($role) use ($user, $attributes) { |
|
182 | 182 | if ($attributes['_id'] == $user->getId() || $user->isAdmin()) { |
183 | 183 | return $role->hasPassword(); |
184 | 184 | } |
185 | 185 | |
186 | 186 | return null; |
187 | 187 | }, |
188 | - 'auth' => function () use ($user) { |
|
188 | + 'auth' => function() use ($user) { |
|
189 | 189 | $identity = $user->getIdentity(); |
190 | 190 | if ($identity === null) { |
191 | 191 | return null; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | if ( |
83 | 83 | !($this->auth->getIdentity()->getAdapter() instanceof AuthNone)) { |
84 | - $this->auth->getIdentity()->getAttributeMap()->addMapper('binary', function ($value) { |
|
84 | + $this->auth->getIdentity()->getAttributeMap()->addMapper('binary', function($value) { |
|
85 | 85 | return new Binary($value, Binary::TYPE_GENERIC); |
86 | 86 | }); |
87 | 87 | |
@@ -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, |
@@ -62,6 +62,8 @@ |
||
62 | 62 | |
63 | 63 | /** |
64 | 64 | * Search. |
65 | + * @param integer $skip |
|
66 | + * @param integer $limit |
|
65 | 67 | */ |
66 | 68 | public function search(array $query, int $deleted = NodeInterface::DELETED_INCLUDE, ?int $skip = null, ?int $limit = null, ?int &$total = null): Generator |
67 | 69 | { |
@@ -236,6 +236,7 @@ discard block |
||
236 | 236 | |
237 | 237 | /** |
238 | 238 | * Find one. |
239 | + * @param Collection $parent |
|
239 | 240 | */ |
240 | 241 | public function findOne(array $filter, int $deleted = NodeInterface::DELETED_INCLUDE, ?Collection $parent = null): NodeInterface |
241 | 242 | { |
@@ -433,6 +434,8 @@ discard block |
||
433 | 434 | * Get deleted nodes. |
434 | 435 | * |
435 | 436 | * Note this query excludes deleted nodes which have a deleted parent |
437 | + * @param integer $offset |
|
438 | + * @param integer $limit |
|
436 | 439 | */ |
437 | 440 | public function getTrash(array $query = [], ?int $offset = null, ?int $limit = null): Generator |
438 | 441 | { |
@@ -572,6 +575,8 @@ discard block |
||
572 | 575 | * Get custom filtered children. |
573 | 576 | * |
574 | 577 | * @deprecated |
578 | + * @param integer $offset |
|
579 | + * @param integer $limit |
|
575 | 580 | */ |
576 | 581 | public function findNodesByFilterUser(int $deleted, array $filter, ?int $offset = null, ?int $limit = null): Generator |
577 | 582 | { |