Passed
Push — master ( e280c0...f0b46e )
by Joas
14:20 queued 11s
created
apps/files/lib/Service/OwnershipTransferService.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 		$output = $output ?? new NullOutput();
100 100
 		$sourceUid = $sourceUser->getUID();
101 101
 		$destinationUid = $destinationUser->getUID();
102
-		$sourcePath = rtrim($sourceUid . '/files/' . $path, '/');
102
+		$sourcePath = rtrim($sourceUid.'/files/'.$path, '/');
103 103
 
104 104
 		// target user has to be ready
105 105
 		if ($destinationUser->getLastLogin() === 0 || !$this->encryptionManager->isReadyForUser($destinationUid)) {
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 							   OutputInterface $output): void {
205 205
 		$output->writeln('Validating quota');
206 206
 		$size = $view->getFileInfo($sourcePath, false)->getSize(false);
207
-		$freeSpace = $view->free_space($destinationUid . '/files/');
207
+		$freeSpace = $view->free_space($destinationUid.'/files/');
208 208
 		if ($size > $freeSpace && $freeSpace !== FileInfo::SPACE_UNKNOWN) {
209 209
 			$output->writeln('<error>Target user does not have enough free space available.</error>');
210 210
 			throw new \Exception('Execution terminated.');
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
 		$encryptedFiles = [];
218 218
 		$this->walkFiles($view, $sourcePath,
219
-			function (FileInfo $fileInfo) use ($progress) {
219
+			function(FileInfo $fileInfo) use ($progress) {
220 220
 				if ($fileInfo->getType() === FileInfo::TYPE_FOLDER) {
221 221
 					// only analyze into folders from main storage,
222 222
 					if (!$fileInfo->getStorage()->instanceOfStorage(IHomeStorage::class)) {
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 			$output->writeln("<error>Some files are encrypted - please decrypt them first.</error>");
239 239
 			foreach ($encryptedFiles as $encryptedFile) {
240 240
 				/** @var FileInfo $encryptedFile */
241
-				$output->writeln("  " . $encryptedFile->getPath());
241
+				$output->writeln("  ".$encryptedFile->getPath());
242 242
 			}
243 243
 			throw new \Exception('Execution terminated.');
244 244
 		}
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 					break;
262 262
 				}
263 263
 				if ($path !== "$sourceUid/files") {
264
-					$sharePage = array_filter($sharePage, function (IShare $share) use ($view, $path) {
264
+					$sharePage = array_filter($sharePage, function(IShare $share) use ($view, $path) {
265 265
 						try {
266 266
 							$relativePath = $view->getPath($share->getNodeId());
267 267
 							$singleFileTranfer = $view->is_file($path);
@@ -270,8 +270,8 @@  discard block
 block discarded – undo
270 270
 							}
271 271
 
272 272
 							return mb_strpos(
273
-								Filesystem::normalizePath($relativePath . '/', false),
274
-								Filesystem::normalizePath($path . '/', false)) === 0;
273
+								Filesystem::normalizePath($relativePath.'/', false),
274
+								Filesystem::normalizePath($path.'/', false)) === 0;
275 275
 						} catch (\Exception $e) {
276 276
 							return false;
277 277
 						}
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 		// Else only the content inside folder is transferred which is not correct.
302 302
 		if ($sourcePath !== "$sourceUid/files") {
303 303
 			$view->mkdir($finalTarget);
304
-			$finalTarget = $finalTarget . '/' . basename($sourcePath);
304
+			$finalTarget = $finalTarget.'/'.basename($sourcePath);
305 305
 		}
306 306
 		if ($view->rename($sourcePath, $finalTarget) === false) {
307 307
 			throw new TransferOwnershipException("Could not transfer files.", 1);
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 				if ($share->getShareType() === IShare::TYPE_USER &&
325 325
 					$share->getSharedWith() === $destinationUid) {
326 326
 					// Unmount the shares before deleting, so we don't try to get the storage later on.
327
-					$shareMountPoint = $this->mountManager->find('/' . $destinationUid . '/files' . $share->getTarget());
327
+					$shareMountPoint = $this->mountManager->find('/'.$destinationUid.'/files'.$share->getTarget());
328 328
 					if ($shareMountPoint) {
329 329
 						$this->mountManager->removeMount($shareMountPoint->getMountPoint());
330 330
 					}
@@ -346,9 +346,9 @@  discard block
 block discarded – undo
346 346
 					$this->shareManager->updateShare($share);
347 347
 				}
348 348
 			} catch (\OCP\Files\NotFoundException $e) {
349
-				$output->writeln('<error>Share with id ' . $share->getId() . ' points at deleted file, skipping</error>');
349
+				$output->writeln('<error>Share with id '.$share->getId().' points at deleted file, skipping</error>');
350 350
 			} catch (\Throwable $e) {
351
-				$output->writeln('<error>Could not restore share with id ' . $share->getId() . ':' . $e->getTraceAsString() . '</error>');
351
+				$output->writeln('<error>Could not restore share with id '.$share->getId().':'.$e->getTraceAsString().'</error>');
352 352
 			}
353 353
 			$progress->advance();
354 354
 		}
Please login to merge, or discard this patch.