@@ -681,6 +681,9 @@ discard block |
||
681 | 681 | return $operationCollection; |
682 | 682 | } |
683 | 683 | |
684 | + /** |
|
685 | + * @param resource $stream |
|
686 | + */ |
|
684 | 687 | protected function readIndexFromStream($stream, \DateTime $created = null): Index |
685 | 688 | { |
686 | 689 | if (!is_resource($stream)) |
@@ -715,6 +718,9 @@ discard block |
||
715 | 718 | fclose($stream); |
716 | 719 | } |
717 | 720 | |
721 | + /** |
|
722 | + * @param resource $stream |
|
723 | + */ |
|
718 | 724 | protected function readSynchronizationListFromStream($stream): SynchronizationList |
719 | 725 | { |
720 | 726 | if (!is_resource($stream)) |
@@ -299,8 +299,7 @@ discard block |
||
299 | 299 | { |
300 | 300 | $newRevision = $newRevision ?: ($lastSynchronization->getRevision() + 1); |
301 | 301 | $remoteIndex = $this->doLoadRemoteIndex($lastSynchronization->getRevision(), $synchronizationList); |
302 | - } |
|
303 | - else |
|
302 | + } else |
|
304 | 303 | { |
305 | 304 | $newRevision = $newRevision ?: 1; |
306 | 305 | $remoteIndex = null; |
@@ -432,12 +431,10 @@ discard block |
||
432 | 431 | try |
433 | 432 | { |
434 | 433 | return $this->doRestore($revision, $progressListener, true); |
435 | - } |
|
436 | - catch (\Exception $exception) |
|
434 | + } catch (\Exception $exception) |
|
437 | 435 | { |
438 | 436 | throw $exception; |
439 | - } |
|
440 | - finally |
|
437 | + } finally |
|
441 | 438 | { |
442 | 439 | $this->localPath = $originalLocalPath; |
443 | 440 | } |
@@ -602,9 +599,7 @@ discard block |
||
602 | 599 | $directoryMtimes[$absoluteLocalPath] = $mergedIndexObject->getMtime(); |
603 | 600 | } |
604 | 601 | } |
605 | - } |
|
606 | - |
|
607 | - elseif ($mergedIndexObject->isFile()) |
|
602 | + } elseif ($mergedIndexObject->isFile()) |
|
608 | 603 | { |
609 | 604 | // local file did not exist, hasn't been a file before or is outdated |
610 | 605 | $doDownloadFile = $localObject === null || !$localObject->isFile() || $localObject->getMtime() < $mergedIndexObject->getMtime(); |
@@ -635,9 +630,7 @@ discard block |
||
635 | 630 | |
636 | 631 | $operationCollection->addOperation(new UploadOperation($absoluteLocalPath, $mergedIndexObject->getBlobId(), $this->vaultConnection, $uploadStreamFilters)); |
637 | 632 | } |
638 | - } |
|
639 | - |
|
640 | - elseif ($mergedIndexObject->isLink()) |
|
633 | + } elseif ($mergedIndexObject->isLink()) |
|
641 | 634 | { |
642 | 635 | $absoluteLinkTarget = dirname($absoluteLocalPath) . DIRECTORY_SEPARATOR . $mergedIndexObject->getLinkTarget(); |
643 | 636 | |
@@ -646,9 +639,7 @@ discard block |
||
646 | 639 | $operationCollection->addOperation(new UnlinkOperation($absoluteLocalPath)); |
647 | 640 | $operationCollection->addOperation(new SymlinkOperation($absoluteLocalPath, $absoluteLinkTarget, $mergedIndexObject->getMode())); |
648 | 641 | } |
649 | - } |
|
650 | - |
|
651 | - else |
|
642 | + } else |
|
652 | 643 | { |
653 | 644 | // unknown/invalid object type |
654 | 645 | throw new Exception(); |