@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | $this->storage = $this->_parent->getStorage()->deleteCollection($this); |
363 | 363 | |
364 | 364 | if (!$this->isReference() && !$this->isMounted() && !$this->isFiltered()) { |
365 | - $this->doRecursiveAction(function ($node) use ($recursion) { |
|
365 | + $this->doRecursiveAction(function($node) use ($recursion) { |
|
366 | 366 | $node->delete(false, $recursion, false); |
367 | 367 | }, NodeInterface::DELETED_EXCLUDE); |
368 | 368 | } |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | protected function _forceDelete(?string $recursion = null, bool $recursion_first = true): bool |
918 | 918 | { |
919 | 919 | if (!$this->isReference() && !$this->isMounted() && !$this->isFiltered()) { |
920 | - $this->doRecursiveAction(function ($node) use ($recursion) { |
|
920 | + $this->doRecursiveAction(function($node) use ($recursion) { |
|
921 | 921 | $node->delete(true, $recursion, false); |
922 | 922 | }, NodeInterface::DELETED_INCLUDE); |
923 | 923 | } |
@@ -296,7 +296,7 @@ |
||
296 | 296 | } |
297 | 297 | |
298 | 298 | $this->logger->debug('elasticsarch blob document ['.$result['_id'].'] has no references left, remove completely', [ |
299 | - 'category' => static::class, |
|
299 | + 'category' => static::class, |
|
300 | 300 | ]); |
301 | 301 | |
302 | 302 | return $this->deleteBlob($result['_id']); |
@@ -134,7 +134,7 @@ |
||
134 | 134 | /** |
135 | 135 | * {@inheritdoc} |
136 | 136 | */ |
137 | - public function preServerIdentity(Identity $identity, ?User &$user): void |
|
137 | + public function preServerIdentity(Identity $identity, ?User & $user): void |
|
138 | 138 | { |
139 | 139 | if (null === $user || (preg_match('#^/index.php/api/v2/tokens#', $_SERVER['ORIG_SCRIPT_NAME']) && isset($_POST['grant_type']) && (preg_match('#_mfa$#', $_POST['grant_type']) || $_POST['grant_type'] === 'refresh_token'))) { |
140 | 140 | return; |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | ->setCode(200) |
191 | 191 | ->setHeader('X-WOPI-Lock', '') |
192 | 192 | ->setBody($e); |
193 | - } catch (Exception\Locked|Exception\LockIdMissmatch|Exception\Forbidden $e) { |
|
193 | + } catch (Exception\Locked | Exception\LockIdMissmatch | Exception\Forbidden $e) { |
|
194 | 194 | $lock = $file->getLock(); |
195 | 195 | |
196 | 196 | return (new Response()) |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | ->setCode(200) |
243 | 243 | ->setHeader('X-WOPI-ItemVersion', (string) ($version == $result ? $result : $result)) |
244 | 244 | ->setBody($result); |
245 | - } catch (Exception\Locked|Exception\LockIdMissmatch $e) { |
|
245 | + } catch (Exception\Locked | Exception\LockIdMissmatch $e) { |
|
246 | 246 | $lock = $file->getLock(); |
247 | 247 | |
248 | 248 | return $response |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $response = (new Response()) |
268 | 268 | ->setCode(200) |
269 | 269 | ->setHeader('X-WOPI-ItemVersion', (string) $file->getVersion()) |
270 | - ->setBody(function () use ($stream) { |
|
270 | + ->setBody(function() use ($stream) { |
|
271 | 271 | if ($stream === null) { |
272 | 272 | echo ''; |
273 | 273 |
@@ -293,46 +293,46 @@ discard block |
||
293 | 293 | } |
294 | 294 | |
295 | 295 | return $response->setOutputFormat(null) |
296 | - ->setBody(function () use ($node, $encode, $offset, $length) { |
|
297 | - $mime = $node->getContentType(); |
|
298 | - $stream = $node->get(); |
|
299 | - $name = $node->getName(); |
|
300 | - |
|
301 | - if (null === $stream) { |
|
302 | - return; |
|
303 | - } |
|
304 | - |
|
305 | - if (0 !== $offset) { |
|
306 | - if (fseek($stream, $offset) === -1) { |
|
307 | - throw new Exception\Conflict('invalid offset requested', Exception\Conflict::INVALID_OFFSET); |
|
308 | - } |
|
309 | - } |
|
310 | - |
|
311 | - $read = 0; |
|
312 | - header('Content-Type: '.$mime.''); |
|
313 | - if ('base64' === $encode) { |
|
314 | - header('Content-Encoding: base64'); |
|
315 | - while (!feof($stream)) { |
|
316 | - if (0 !== $length && $read + 8192 > $length) { |
|
317 | - echo base64_encode(fread($stream, $length - $read)); |
|
318 | - exit(); |
|
319 | - } |
|
320 | - |
|
321 | - echo base64_encode(fread($stream, 8192)); |
|
322 | - $read += 8192; |
|
323 | - } |
|
324 | - } else { |
|
325 | - while (!feof($stream)) { |
|
326 | - if (0 !== $length && $read + 8192 > $length) { |
|
327 | - echo fread($stream, $length - $read); |
|
328 | - exit(); |
|
329 | - } |
|
330 | - |
|
331 | - echo fread($stream, 8192); |
|
332 | - $read += 8192; |
|
333 | - } |
|
334 | - } |
|
335 | - }); |
|
296 | + ->setBody(function () use ($node, $encode, $offset, $length) { |
|
297 | + $mime = $node->getContentType(); |
|
298 | + $stream = $node->get(); |
|
299 | + $name = $node->getName(); |
|
300 | + |
|
301 | + if (null === $stream) { |
|
302 | + return; |
|
303 | + } |
|
304 | + |
|
305 | + if (0 !== $offset) { |
|
306 | + if (fseek($stream, $offset) === -1) { |
|
307 | + throw new Exception\Conflict('invalid offset requested', Exception\Conflict::INVALID_OFFSET); |
|
308 | + } |
|
309 | + } |
|
310 | + |
|
311 | + $read = 0; |
|
312 | + header('Content-Type: '.$mime.''); |
|
313 | + if ('base64' === $encode) { |
|
314 | + header('Content-Encoding: base64'); |
|
315 | + while (!feof($stream)) { |
|
316 | + if (0 !== $length && $read + 8192 > $length) { |
|
317 | + echo base64_encode(fread($stream, $length - $read)); |
|
318 | + exit(); |
|
319 | + } |
|
320 | + |
|
321 | + echo base64_encode(fread($stream, 8192)); |
|
322 | + $read += 8192; |
|
323 | + } |
|
324 | + } else { |
|
325 | + while (!feof($stream)) { |
|
326 | + if (0 !== $length && $read + 8192 > $length) { |
|
327 | + echo fread($stream, $length - $read); |
|
328 | + exit(); |
|
329 | + } |
|
330 | + |
|
331 | + echo fread($stream, 8192); |
|
332 | + $read += 8192; |
|
333 | + } |
|
334 | + } |
|
335 | + }); |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | /** |
@@ -1327,9 +1327,9 @@ discard block |
||
1327 | 1327 | $node->zip($archive); |
1328 | 1328 | } catch (\Exception $e) { |
1329 | 1329 | $this->logger->debug('failed zip node in multi node request ['.$node->getId().']', [ |
1330 | - 'category' => static::class, |
|
1331 | - 'exception' => $e, |
|
1332 | - ]); |
|
1330 | + 'category' => static::class, |
|
1331 | + 'exception' => $e, |
|
1332 | + ]); |
|
1333 | 1333 | } |
1334 | 1334 | } |
1335 | 1335 |
@@ -457,9 +457,9 @@ |
||
457 | 457 | $node->zip($archive); |
458 | 458 | } catch (\Exception $e) { |
459 | 459 | $this->logger->debug('failed zip node in multi node request ['.$node->getId().']', [ |
460 | - 'category' => static::class, |
|
461 | - 'exception' => $e, |
|
462 | - ]); |
|
460 | + 'category' => static::class, |
|
461 | + 'exception' => $e, |
|
462 | + ]); |
|
463 | 463 | } |
464 | 464 | } |
465 | 465 |
@@ -39,7 +39,7 @@ |
||
39 | 39 | { |
40 | 40 | try { |
41 | 41 | $this->createIndex(); |
42 | - } catch (CommandException|RuntimeException $e) { |
|
42 | + } catch (CommandException | RuntimeException $e) { |
|
43 | 43 | if ($e->getCode() === 85) { |
44 | 44 | $this->db->selectCollection('fs.files')->dropIndex('md5_1'); |
45 | 45 | $this->createIndex(); |
@@ -39,7 +39,7 @@ |
||
39 | 39 | { |
40 | 40 | try { |
41 | 41 | $this->createIndex(); |
42 | - } catch (CommandException|RuntimeException $e) { |
|
42 | + } catch (CommandException | RuntimeException $e) { |
|
43 | 43 | if ($e->getCode() === 85) { |
44 | 44 | $this->db->selectCollection('user')->dropIndex('mail_1'); |
45 | 45 | $this->createIndex(); |
@@ -39,7 +39,7 @@ |
||
39 | 39 | { |
40 | 40 | try { |
41 | 41 | $this->createIndex(); |
42 | - } catch (CommandException|RuntimeException $e) { |
|
42 | + } catch (CommandException | RuntimeException $e) { |
|
43 | 43 | if ($e->getCode() === 85) { |
44 | 44 | $this->db->selectCollection('user')->dropIndex('mail_1'); |
45 | 45 | $this->createIndex(); |