Completed
Push — master ( 910687...35930a )
by Robin
37:15 queued 58s
created
apps/dav/lib/Connector/Sabre/File.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 		if ($needsPartFile) {
133 133
 			$transferId = \rand();
134 134
 			// mark file as partial while uploading (ignored by the scanner)
135
-			$partFilePath = $this->getPartFileBasePath($this->path) . '.ocTransferId' . $transferId . '.part';
135
+			$partFilePath = $this->getPartFileBasePath($this->path).'.ocTransferId'.$transferId.'.part';
136 136
 
137 137
 			if (!$view->isCreatable($partFilePath) && $view->isUpdatable($this->path)) {
138 138
 				$needsPartFile = false;
@@ -186,27 +186,27 @@  discard block
 block discarded – undo
186 186
 			if ($this->request->getHeader('X-HASH') !== '') {
187 187
 				$hash = $this->request->getHeader('X-HASH');
188 188
 				if ($hash === 'all' || $hash === 'md5') {
189
-					$data = HashWrapper::wrap($data, 'md5', function ($hash): void {
190
-						$this->header('X-Hash-MD5: ' . $hash);
189
+					$data = HashWrapper::wrap($data, 'md5', function($hash): void {
190
+						$this->header('X-Hash-MD5: '.$hash);
191 191
 					});
192 192
 				}
193 193
 
194 194
 				if ($hash === 'all' || $hash === 'sha1') {
195
-					$data = HashWrapper::wrap($data, 'sha1', function ($hash): void {
196
-						$this->header('X-Hash-SHA1: ' . $hash);
195
+					$data = HashWrapper::wrap($data, 'sha1', function($hash): void {
196
+						$this->header('X-Hash-SHA1: '.$hash);
197 197
 					});
198 198
 				}
199 199
 
200 200
 				if ($hash === 'all' || $hash === 'sha256') {
201
-					$data = HashWrapper::wrap($data, 'sha256', function ($hash): void {
202
-						$this->header('X-Hash-SHA256: ' . $hash);
201
+					$data = HashWrapper::wrap($data, 'sha256', function($hash): void {
202
+						$this->header('X-Hash-SHA256: '.$hash);
203 203
 					});
204 204
 				}
205 205
 			}
206 206
 
207 207
 			if ($partStorage->instanceOfStorage(IWriteStreamStorage::class)) {
208 208
 				$isEOF = false;
209
-				$wrappedData = CallbackWrapper::wrap($data, null, null, null, null, function ($stream) use (&$isEOF): void {
209
+				$wrappedData = CallbackWrapper::wrap($data, null, null, null, null, function($stream) use (&$isEOF): void {
210 210
 					$isEOF = feof($stream);
211 211
 				});
212 212
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 						$count = $partStorage->writeStream($internalPartPath, $wrappedData);
219 219
 					} catch (GenericFileException $e) {
220 220
 						$logger = Server::get(LoggerInterface::class);
221
-						$logger->error('Error while writing stream to storage: ' . $e->getMessage(), ['exception' => $e, 'app' => 'webdav']);
221
+						$logger->error('Error while writing stream to storage: '.$e->getMessage(), ['exception' => $e, 'app' => 'webdav']);
222 222
 						$result = $isEOF;
223 223
 						if (is_resource($wrappedData)) {
224 224
 							$result = feof($wrappedData);
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 			}
238 238
 
239 239
 			$lengthHeader = $this->request->getHeader('content-length');
240
-			$expected = $lengthHeader !== '' ? (int)$lengthHeader : -1;
240
+			$expected = $lengthHeader !== '' ? (int) $lengthHeader : -1;
241 241
 			if ($result === false && $expected >= 0) {
242 242
 				throw new Exception(
243 243
 					$this->l10n->t(
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 					$renameOkay = $storage->moveFromStorage($partStorage, $internalPartPath, $internalPath);
313 313
 					$fileExists = $storage->file_exists($internalPath);
314 314
 					if ($renameOkay === false || $fileExists === false) {
315
-						Server::get(LoggerInterface::class)->error('renaming part file to final file failed $renameOkay: ' . ($renameOkay ? 'true' : 'false') . ', $fileExists: ' . ($fileExists ? 'true' : 'false') . ')', ['app' => 'webdav']);
315
+						Server::get(LoggerInterface::class)->error('renaming part file to final file failed $renameOkay: '.($renameOkay ? 'true' : 'false').', $fileExists: '.($fileExists ? 'true' : 'false').')', ['app' => 'webdav']);
316 316
 						throw new Exception($this->l10n->t('Could not rename part file to final file'));
317 317
 					}
318 318
 				} catch (ForbiddenException $ex) {
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 			throw new ServiceUnavailable($this->l10n->t('Failed to check file size: %1$s', [$e->getMessage()]), 0, $e);
376 376
 		}
377 377
 
378
-		return '"' . $this->info->getEtag() . '"';
378
+		return '"'.$this->info->getEtag().'"';
379 379
 	}
380 380
 
381 381
 	private function getPartFileBasePath($path) {
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 			$filename = basename($path);
385 385
 			// hash does not need to be secure but fast and semi unique
386 386
 			$hashedFilename = hash('xxh128', $filename);
387
-			return substr($path, 0, strlen($path) - strlen($filename)) . $hashedFilename;
387
+			return substr($path, 0, strlen($path) - strlen($filename)).$hashedFilename;
388 388
 		} else {
389 389
 			// will place the .part file in the users root directory
390 390
 			// therefor we need to make the name (semi) unique - hash does not need to be secure but fast.
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 			// if different, fix DB and refresh cache.
478 478
 			if ($this->getSize() !== $this->fileView->filesize($this->getPath())) {
479 479
 				$logger = Server::get(LoggerInterface::class);
480
-				$logger->warning('fixing cached size of file id=' . $this->getId());
480
+				$logger->warning('fixing cached size of file id='.$this->getId());
481 481
 
482 482
 				$this->getFileInfo()->getStorage()->getUpdater()->update($this->getFileInfo()->getInternalPath());
483 483
 				$this->refreshInfo();
Please login to merge, or discard this patch.