@@ -209,9 +209,9 @@ discard block |
||
| 209 | 209 | stream_wrapper_register($protocol, $class); |
| 210 | 210 | $context = self::buildContext($protocol, $context, $source); |
| 211 | 211 | if (self::isDirectoryHandle($source)) { |
| 212 | - $wrapped = opendir($protocol . '://', $context); |
|
| 212 | + $wrapped = opendir($protocol.'://', $context); |
|
| 213 | 213 | } else { |
| 214 | - $wrapped = fopen($protocol . '://', $mode, false, $context); |
|
| 214 | + $wrapped = fopen($protocol.'://', $mode, false, $context); |
|
| 215 | 215 | } |
| 216 | 216 | } catch (\BadMethodCallException $e) { |
| 217 | 217 | stream_wrapper_unregister($protocol); |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | if (array_key_exists($property, $context)) { |
| 248 | 248 | $this->{$property} = $context[$property]; |
| 249 | 249 | } else { |
| 250 | - throw new \BadMethodCallException('Invalid context, "' . $property . '" options not set'); |
|
| 250 | + throw new \BadMethodCallException('Invalid context, "'.$property.'" options not set'); |
|
| 251 | 251 | } |
| 252 | 252 | } |
| 253 | 253 | return $context; |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | |
| 371 | 371 | // for seekable streams the pointer is moved back to the beginning of the encrypted block |
| 372 | 372 | // flush will start writing there when the position moves to another block |
| 373 | - $positionInFile = (int)floor($this->position / $this->unencryptedBlockSize) * |
|
| 373 | + $positionInFile = (int) floor($this->position / $this->unencryptedBlockSize) * |
|
| 374 | 374 | $this->util->getBlockSize() + $this->headerSize; |
| 375 | 375 | $resultFseek = $this->parentStreamSeek($positionInFile); |
| 376 | 376 | |
@@ -388,14 +388,14 @@ discard block |
||
| 388 | 388 | // update position and liberate $data |
| 389 | 389 | if ($remainingLength < ($this->unencryptedBlockSize - $blockPosition)) { |
| 390 | 390 | $this->cache = substr($this->cache, 0, $blockPosition) |
| 391 | - . $data . substr($this->cache, $blockPosition + $remainingLength); |
|
| 391 | + . $data.substr($this->cache, $blockPosition + $remainingLength); |
|
| 392 | 392 | $this->position += $remainingLength; |
| 393 | 393 | $length += $remainingLength; |
| 394 | 394 | $data = ''; |
| 395 | 395 | // if $data doesn't fit the current block, the fill the current block and reiterate |
| 396 | 396 | // after the block is filled, it is flushed and $data is updatedxxx |
| 397 | 397 | } else { |
| 398 | - $this->cache = substr($this->cache, 0, $blockPosition) . |
|
| 398 | + $this->cache = substr($this->cache, 0, $blockPosition). |
|
| 399 | 399 | substr($data, 0, $this->unencryptedBlockSize - $blockPosition); |
| 400 | 400 | $this->flush(); |
| 401 | 401 | $this->position += ($this->unencryptedBlockSize - $blockPosition); |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | return $return; |
| 436 | 436 | } |
| 437 | 437 | |
| 438 | - $newFilePosition = (int)floor($newPosition / $this->unencryptedBlockSize) |
|
| 438 | + $newFilePosition = (int) floor($newPosition / $this->unencryptedBlockSize) |
|
| 439 | 439 | * $this->util->getBlockSize() + $this->headerSize; |
| 440 | 440 | |
| 441 | 441 | $oldFilePosition = parent::stream_tell(); |
@@ -451,8 +451,8 @@ discard block |
||
| 451 | 451 | |
| 452 | 452 | public function stream_close() { |
| 453 | 453 | $this->flush('end'); |
| 454 | - $position = (int)floor($this->position / $this->unencryptedBlockSize); |
|
| 455 | - $remainingData = $this->encryptionModule->end($this->fullPath, $position . 'end'); |
|
| 454 | + $position = (int) floor($this->position / $this->unencryptedBlockSize); |
|
| 455 | + $remainingData = $this->encryptionModule->end($this->fullPath, $position.'end'); |
|
| 456 | 456 | if ($this->readOnly === false) { |
| 457 | 457 | if (!empty($remainingData)) { |
| 458 | 458 | parent::stream_write($remainingData); |
@@ -484,16 +484,16 @@ discard block |
||
| 484 | 484 | // automatically attempted when the file is written to disk - |
| 485 | 485 | // we are handling that separately here and we don't want to |
| 486 | 486 | // get into an infinite loop |
| 487 | - $position = (int)floor($this->position / $this->unencryptedBlockSize); |
|
| 488 | - $encrypted = $this->encryptionModule->encrypt($this->cache, $position . $positionPrefix); |
|
| 487 | + $position = (int) floor($this->position / $this->unencryptedBlockSize); |
|
| 488 | + $encrypted = $this->encryptionModule->encrypt($this->cache, $position.$positionPrefix); |
|
| 489 | 489 | $bytesWritten = parent::stream_write($encrypted); |
| 490 | 490 | $this->writeFlag = false; |
| 491 | 491 | // Check whether the write concerns the last block |
| 492 | 492 | // If so then update the encrypted filesize |
| 493 | 493 | // Note that the unencrypted pointer and filesize are NOT yet updated when flush() is called |
| 494 | 494 | // We recalculate the encrypted filesize as we do not know the context of calling flush() |
| 495 | - $completeBlocksInFile = (int)floor($this->unencryptedSize / $this->unencryptedBlockSize); |
|
| 496 | - if ($completeBlocksInFile === (int)floor($this->position / $this->unencryptedBlockSize)) { |
|
| 495 | + $completeBlocksInFile = (int) floor($this->unencryptedSize / $this->unencryptedBlockSize); |
|
| 496 | + if ($completeBlocksInFile === (int) floor($this->position / $this->unencryptedBlockSize)) { |
|
| 497 | 497 | $this->size = $this->util->getBlockSize() * $completeBlocksInFile; |
| 498 | 498 | $this->size += $bytesWritten; |
| 499 | 499 | $this->size += $this->headerSize; |
@@ -512,8 +512,8 @@ discard block |
||
| 512 | 512 | if ($this->cache === '' && !($this->position === $this->unencryptedSize && ($this->position % $this->unencryptedBlockSize) === 0)) { |
| 513 | 513 | // Get the data from the file handle |
| 514 | 514 | $data = $this->stream_read_block($this->util->getBlockSize()); |
| 515 | - $position = (int)floor($this->position / $this->unencryptedBlockSize); |
|
| 516 | - $numberOfChunks = (int)($this->unencryptedSize / $this->unencryptedBlockSize); |
|
| 515 | + $position = (int) floor($this->position / $this->unencryptedBlockSize); |
|
| 516 | + $numberOfChunks = (int) ($this->unencryptedSize / $this->unencryptedBlockSize); |
|
| 517 | 517 | if ($numberOfChunks === $position) { |
| 518 | 518 | $position .= 'end'; |
| 519 | 519 | } |
@@ -69,13 +69,13 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | $counter = 0; |
| 72 | - $this->userManager->callForSeenUsers(function (IUser $user) use ($counter) { |
|
| 72 | + $this->userManager->callForSeenUsers(function(IUser $user) use ($counter) { |
|
| 73 | 73 | $uid = $user->getUID(); |
| 74 | 74 | |
| 75 | - $path = 'avatars/' . $this->buildOwnCloudAvatarPath($uid); |
|
| 75 | + $path = 'avatars/'.$this->buildOwnCloudAvatarPath($uid); |
|
| 76 | 76 | $avatar = $this->avatarManager->getAvatar($uid); |
| 77 | 77 | try { |
| 78 | - $avatarPath = $path . '/avatar.' . $this->getExtension($path); |
|
| 78 | + $avatarPath = $path.'/avatar.'.$this->getExtension($path); |
|
| 79 | 79 | $resource = $this->owncloudAvatarStorage->fopen($avatarPath, 'r'); |
| 80 | 80 | if (is_resource($resource)) { |
| 81 | 81 | $avatar->set($resource); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | } catch (NotFoundException $e) { |
| 87 | 87 | // In case there is no avatar we can just skip |
| 88 | 88 | } catch (\Throwable $e) { |
| 89 | - $this->logger->error('Failed to migrate avatar for user ' . $uid, ['exception' => $e]); |
|
| 89 | + $this->logger->error('Failed to migrate avatar for user '.$uid, ['exception' => $e]); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | $counter++; |