@@ -73,13 +73,13 @@ |
||
| 73 | 73 | /** |
| 74 | 74 | * OcrStatus constructor. |
| 75 | 75 | * |
| 76 | - * @param null $status |
|
| 77 | - * @param null $source |
|
| 78 | - * @param null $target |
|
| 76 | + * @param string $status |
|
| 77 | + * @param string $source |
|
| 78 | + * @param string $target |
|
| 79 | 79 | * @param null $tempFile |
| 80 | - * @param null $type |
|
| 80 | + * @param string $type |
|
| 81 | 81 | * @param null $userId |
| 82 | - * @param null $errorDisplayed |
|
| 82 | + * @param boolean $errorDisplayed |
|
| 83 | 83 | */ |
| 84 | 84 | public function __construct($status = null, $source = null, $target = null, $tempFile = null, $type = null, $userId = null, $errorDisplayed = null) { |
| 85 | 85 | $this->setStatus($status); |
@@ -252,6 +252,7 @@ discard block |
||
| 252 | 252 | * The PersonalSettingsController will have the opportunity to delete ocr status objects. |
| 253 | 253 | * |
| 254 | 254 | * @param $statusId |
| 255 | + * @param string $userId |
|
| 255 | 256 | * @return OcrStatus |
| 256 | 257 | */ |
| 257 | 258 | public function deleteStatus($statusId, $userId) { |
@@ -281,7 +282,7 @@ discard block |
||
| 281 | 282 | /** |
| 282 | 283 | * Gets all status objects for a specific user in order to list them on the personal settings page. |
| 283 | 284 | * |
| 284 | - * @param $userId |
|
| 285 | + * @param string $userId |
|
| 285 | 286 | * @return array |
| 286 | 287 | */ |
| 287 | 288 | public function getAllForPersonal($userId) { |
@@ -429,7 +430,7 @@ discard block |
||
| 429 | 430 | |
| 430 | 431 | /** |
| 431 | 432 | * @param File $fileInfo |
| 432 | - * @return bool |
|
| 433 | + * @return boolean|null |
|
| 433 | 434 | */ |
| 434 | 435 | private function checkSharedWithInitiator($fileInfo) { |
| 435 | 436 | try { |
@@ -169,7 +169,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |