Completed
Pull Request — master (#43)
by Janis
03:35
created
lib/Service/OcrService.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 					$source = $fInfo->getPath();
170 170
 					if ($this->checkSharedWithInitiator($fInfo)) {
171 171
 						// Shared Item
172
-						$source = str_replace('home::','',$fInfo->getStoragename()) . '/' . $source;
172
+						$source = str_replace('home::', '', $fInfo->getStoragename()) . '/' . $source;
173 173
 						$target = $this->buildTargetForShared($fInfo);
174 174
 					} else {
175 175
 						// Not Shared
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 	 */
314 314
 	protected function buildTargetForShared(File $fileInfo) {
315 315
 		try {
316
-			$share = $this->shareMapper->find($fileInfo->getFileid(), $this->userId, str_replace('home::','',$fileInfo->getStoragename()));
316
+			$share = $this->shareMapper->find($fileInfo->getFileid(), $this->userId, str_replace('home::', '', $fileInfo->getStoragename()));
317 317
 
318 318
 			// get rid of the .png or .pdf and so on
319 319
 			$fileName = substr($share->getFileTarget(), 0, -4); // '/thedom.png' => '/thedom' || '/Test/thedom.png' => '/Test/thedom'
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 			$filePath = str_replace('files', '', $filePath); // 'files/Test/' => '/Test/' || 'files/' => '/'
363 363
 
364 364
 			// remove the last slash
365
-			$filePath = substr_replace($filePath,'',strrpos($filePath,'/'),strlen('/')); // '/Test/' => '/Test' || '/' => ''
365
+			$filePath = substr_replace($filePath, '', strrpos($filePath, '/'), strlen('/')); // '/Test/' => '/Test' || '/' => ''
366 366
 
367 367
 			// replace the first slash
368 368
 			$pos = strpos($filePath, '/');
@@ -433,8 +433,8 @@  discard block
 block discarded – undo
433 433
 	 */
434 434
 	private function checkSharedWithInitiator($fileInfo) {
435 435
 		try {
436
-			$owner = str_replace('home::','',$fileInfo->getStoragename());
437
-			if ($this->userId === $owner){
436
+			$owner = str_replace('home::', '', $fileInfo->getStoragename());
437
+			if ($this->userId === $owner) {
438 438
 				// user is owner (no shared file)
439 439
 				return false;
440 440
 			} else {
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
 	 */
489 489
 	private function removeFileExtension($status) {
490 490
 		try {
491
-			return substr($status->getTarget(), 0, strrpos($status->getTarget(),'_OCR'));
491
+			return substr($status->getTarget(), 0, strrpos($status->getTarget(), '_OCR'));
492 492
 		} catch (Exception $e) {
493 493
 			$this->handleException($e);
494 494
 		}
Please login to merge, or discard this patch.