| @@ -601,6 +601,9 @@ discard block | ||
| 601 | 601 | return $operationResultCollection; | 
| 602 | 602 | } | 
| 603 | 603 | |
| 604 | + /** | |
| 605 | + * @param resource $stream | |
| 606 | + */ | |
| 604 | 607 | protected function readIndexFromStream($stream, \DateTime $created = null): Index | 
| 605 | 608 |      { | 
| 606 | 609 | if (!is_resource($stream)) | 
| @@ -635,6 +638,9 @@ discard block | ||
| 635 | 638 | fclose($stream); | 
| 636 | 639 | } | 
| 637 | 640 | |
| 641 | + /** | |
| 642 | + * @param resource $stream | |
| 643 | + */ | |
| 638 | 644 | protected function readSynchronizationListFromStream($stream): SynchronizationList | 
| 639 | 645 |      { | 
| 640 | 646 | if (!is_resource($stream)) | 
| @@ -331,8 +331,7 @@ discard block | ||
| 331 | 331 |          { | 
| 332 | 332 | $newRevision = $newRevision ?: ($lastSynchronization->getRevision() + 1); | 
| 333 | 333 | $remoteIndex = $this->doLoadRemoteIndex($lastSynchronization->getRevision(), $synchronizationList); | 
| 334 | - } | |
| 335 | - else | |
| 334 | + } else | |
| 336 | 335 |          { | 
| 337 | 336 | $newRevision = $newRevision ?: 1; | 
| 338 | 337 | $remoteIndex = null; | 
| @@ -474,12 +473,10 @@ discard block | ||
| 474 | 473 | try | 
| 475 | 474 |          { | 
| 476 | 475 | return $this->doRestore($revision, $progressListener, true); | 
| 477 | - } | |
| 478 | - catch (\Exception $exception) | |
| 476 | + } catch (\Exception $exception) | |
| 479 | 477 |          { | 
| 480 | 478 | throw $exception; | 
| 481 | - } | |
| 482 | - finally | |
| 479 | + } finally | |
| 483 | 480 |          { | 
| 484 | 481 | $this->localPath = $originalLocalPath; | 
| 485 | 482 | } | 
| @@ -90,9 +90,7 @@ discard block | ||
| 90 | 90 | $directoryMtimes[$mergedIndexObject->getRelativePath()] = $mergedIndexObject->getMtime(); | 
| 91 | 91 | } | 
| 92 | 92 | } | 
| 93 | - } | |
| 94 | - | |
| 95 | - elseif ($mergedIndexObject->isFile()) | |
| 93 | + } elseif ($mergedIndexObject->isFile()) | |
| 96 | 94 |              { | 
| 97 | 95 | // local file did not exist, hasn't been a file before or is outdated | 
| 98 | 96 | $doDownloadFile = $localObject === null || !$localObject->isFile() || $localObject->getMtime() < $mergedIndexObject->getMtime(); | 
| @@ -123,9 +121,7 @@ discard block | ||
| 123 | 121 | |
| 124 | 122 | $operationCollection->addOperation(new UploadOperation($relativePath, $mergedIndexObject->getBlobId(), $vaultConnection, $uploadStreamFilters)); | 
| 125 | 123 | } | 
| 126 | - } | |
| 127 | - | |
| 128 | - elseif ($mergedIndexObject->isLink()) | |
| 124 | + } elseif ($mergedIndexObject->isLink()) | |
| 129 | 125 |              { | 
| 130 | 126 | $absoluteLinkTarget = dirname($relativePath) . DIRECTORY_SEPARATOR . $mergedIndexObject->getLinkTarget(); | 
| 131 | 127 | |
| @@ -136,9 +132,7 @@ discard block | ||
| 136 | 132 | |
| 137 | 133 | $modifiedPaths[] = $mergedIndexObject->getRelativePath(); | 
| 138 | 134 | } | 
| 139 | - } | |
| 140 | - | |
| 141 | - else | |
| 135 | + } else | |
| 142 | 136 |              { | 
| 143 | 137 | // unknown/invalid object type | 
| 144 | 138 | throw new Exception(); |