@@ -263,7 +263,7 @@ |
||
263 | 263 | $response = (new Response()) |
264 | 264 | ->setCode(200) |
265 | 265 | ->setHeader('X-WOPI-ItemVersion', (string) $file->getVersion()) |
266 | - ->setBody(function () use ($stream) { |
|
266 | + ->setBody(function() use ($stream) { |
|
267 | 267 | if ($stream === null) { |
268 | 268 | echo ''; |
269 | 269 |
@@ -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 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | } |
103 | 103 | } |
104 | 104 | |
105 | - return $this->bulk($id, function ($node) use ($parent, $conflict, $move) { |
|
105 | + return $this->bulk($id, function($node) use ($parent, $conflict, $move) { |
|
106 | 106 | if (true === $move) { |
107 | 107 | $node = $node->setParent($parent, $conflict); |
108 | 108 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | return (new Response())->setCode(200)->setBody($result); |
170 | 170 | } |
171 | 171 | |
172 | - return $this->bulk($id, function ($node) use ($attributes) { |
|
172 | + return $this->bulk($id, function($node) use ($attributes) { |
|
173 | 173 | return [ |
174 | 174 | 'code' => 200, |
175 | 175 | 'data' => $this->node_decorator->decorate($node, $attributes), |
@@ -205,11 +205,11 @@ discard block |
||
205 | 205 | public function patch(string $id, ?string $name = null, ?array $meta = null, ?bool $readonly = null, ?array $filter = null, ?array $acl = null, $lock = null): Response |
206 | 206 | { |
207 | 207 | $attributes = compact('name', 'meta', 'readonly', 'filter', 'acl', 'lock'); |
208 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
208 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
209 | 209 | |
210 | 210 | $lock = $_SERVER['HTTP_LOCK_TOKEN'] ?? null; |
211 | 211 | |
212 | - return $this->bulk($id, function ($node) use ($attributes, $lock) { |
|
212 | + return $this->bulk($id, function($node) use ($attributes, $lock) { |
|
213 | 213 | foreach ($attributes as $attribute => $value) { |
214 | 214 | switch ($attribute) { |
215 | 215 | case 'name': |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | ); |
270 | 270 | } |
271 | 271 | |
272 | - return $this->bulk($id, function ($node) use ($parent, $conflict) { |
|
272 | + return $this->bulk($id, function($node) use ($parent, $conflict) { |
|
273 | 273 | $result = $node->copyTo($parent, $conflict); |
274 | 274 | |
275 | 275 | return [ |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | ); |
297 | 297 | } |
298 | 298 | |
299 | - return $this->bulk($id, function ($node) use ($parent, $conflict) { |
|
299 | + return $this->bulk($id, function($node) use ($parent, $conflict) { |
|
300 | 300 | $result = $node->setParent($parent, $conflict); |
301 | 301 | |
302 | 302 | return [ |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | $at = $this->_verifyAttributes(['destroy' => $at])['destroy']; |
322 | 322 | } |
323 | 323 | |
324 | - return $this->bulk($id, function ($node) use ($force, $ignore_flag, $at) { |
|
324 | + return $this->bulk($id, function($node) use ($force, $ignore_flag, $at) { |
|
325 | 325 | if (null === $at) { |
326 | 326 | $node->delete($force && $node->isDeleted() || $force && $ignore_flag); |
327 | 327 | } else { |
@@ -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; |
@@ -113,20 +113,20 @@ discard block |
||
113 | 113 | 'mime' => (string) $attributes['mime'], |
114 | 114 | 'readonly' => (bool) $attributes['readonly'], |
115 | 115 | 'directory' => $node instanceof Collection, |
116 | - 'meta' => function ($node) { |
|
116 | + 'meta' => function($node) { |
|
117 | 117 | return (object) $node->getMetaAttributes(); |
118 | 118 | }, |
119 | - 'size' => function ($node) { |
|
119 | + 'size' => function($node) { |
|
120 | 120 | return $node->getSize(); |
121 | 121 | }, |
122 | - 'path' => function ($node) { |
|
122 | + 'path' => function($node) { |
|
123 | 123 | try { |
124 | 124 | return $node->getPath(); |
125 | 125 | } catch (\Exception $e) { |
126 | 126 | return null; |
127 | 127 | } |
128 | 128 | }, |
129 | - 'parent' => function ($node) { |
|
129 | + 'parent' => function($node) { |
|
130 | 130 | $parent = $node->getParent(); |
131 | 131 | |
132 | 132 | if (null === $parent || $parent->isRoot()) { |
@@ -135,17 +135,17 @@ discard block |
||
135 | 135 | |
136 | 136 | return $this->decorate($node->getParent(), ['id', 'name', '_links']); |
137 | 137 | }, |
138 | - 'access' => function ($node) use ($acl) { |
|
138 | + 'access' => function($node) use ($acl) { |
|
139 | 139 | return $acl->getAclPrivilege($node); |
140 | 140 | }, |
141 | - 'acl' => function ($node) use ($attributes) { |
|
141 | + 'acl' => function($node) use ($attributes) { |
|
142 | 142 | if ($node->isShareMember() && count($attributes['acl']) > 0) { |
143 | 143 | return $node->getAcl(); |
144 | 144 | } |
145 | 145 | |
146 | 146 | return null; |
147 | 147 | }, |
148 | - 'lock' => function ($node) use ($server, $decorator, $attributes) { |
|
148 | + 'lock' => function($node) use ($server, $decorator, $attributes) { |
|
149 | 149 | if (!$node->isLocked()) { |
150 | 150 | return null; |
151 | 151 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | 'id' => $lock['id'], |
171 | 171 | ]; |
172 | 172 | }, |
173 | - 'share' => function ($node) use ($fs) { |
|
173 | + 'share' => function($node) use ($fs) { |
|
174 | 174 | if ($node->isShared() || !$node->isSpecial()) { |
175 | 175 | return null; |
176 | 176 | } |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | return null; |
182 | 182 | } |
183 | 183 | }, |
184 | - 'sharename' => function ($node) { |
|
184 | + 'sharename' => function($node) { |
|
185 | 185 | if (!$node->isShared()) { |
186 | 186 | return null; |
187 | 187 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | return null; |
193 | 193 | } |
194 | 194 | }, |
195 | - 'shareowner' => function ($node) use ($server, $fs, $decorator) { |
|
195 | + 'shareowner' => function($node) use ($server, $fs, $decorator) { |
|
196 | 196 | if (!$node->isSpecial()) { |
197 | 197 | return null; |
198 | 198 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | return null; |
207 | 207 | } |
208 | 208 | }, |
209 | - 'owner' => function ($node) use ($server, $decorator) { |
|
209 | + 'owner' => function($node) use ($server, $decorator) { |
|
210 | 210 | try { |
211 | 211 | return $decorator->decorate( |
212 | 212 | $server->getUserById($node->getOwner()), |
@@ -227,20 +227,20 @@ discard block |
||
227 | 227 | protected function getTimeAttributes(NodeInterface $node, array $attributes): array |
228 | 228 | { |
229 | 229 | return [ |
230 | - 'created' => function ($node) use ($attributes) { |
|
230 | + 'created' => function($node) use ($attributes) { |
|
231 | 231 | return $attributes['created']->toDateTime()->format('c'); |
232 | 232 | }, |
233 | - 'changed' => function ($node) use ($attributes) { |
|
233 | + 'changed' => function($node) use ($attributes) { |
|
234 | 234 | return $attributes['changed']->toDateTime()->format('c'); |
235 | 235 | }, |
236 | - 'deleted' => function ($node) use ($attributes) { |
|
236 | + 'deleted' => function($node) use ($attributes) { |
|
237 | 237 | if (false === $attributes['deleted']) { |
238 | 238 | return null; |
239 | 239 | } |
240 | 240 | |
241 | 241 | return $attributes['deleted']->toDateTime()->format('c'); |
242 | 242 | }, |
243 | - 'destroy' => function ($node) use ($attributes) { |
|
243 | + 'destroy' => function($node) use ($attributes) { |
|
244 | 244 | if (null === $attributes['destroy']) { |
245 | 245 | return null; |
246 | 246 | } |
@@ -268,14 +268,14 @@ discard block |
||
268 | 268 | return [ |
269 | 269 | 'shared' => $node->isShared(), |
270 | 270 | 'reference' => $node->isReference(), |
271 | - 'filter' => function ($node) use ($attributes) { |
|
271 | + 'filter' => function($node) use ($attributes) { |
|
272 | 272 | if (null === $attributes['filter']) { |
273 | 273 | return null; |
274 | 274 | } |
275 | 275 | |
276 | 276 | return json_decode($attributes['filter'], true, 512, JSON_THROW_ON_ERROR); |
277 | 277 | }, |
278 | - 'mount' => function ($node) use ($fs, $attributes) { |
|
278 | + 'mount' => function($node) use ($fs, $attributes) { |
|
279 | 279 | $mount = $node->getAttributes()['mount']; |
280 | 280 | |
281 | 281 | if (!$node->isMounted() && !$node->isReference()) { |
@@ -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, |