@@ -548,6 +548,9 @@ discard block |
||
| 548 | 548 | return $operationCollection; |
| 549 | 549 | } |
| 550 | 550 | |
| 551 | + /** |
|
| 552 | + * @param resource $stream |
|
| 553 | + */ |
|
| 551 | 554 | protected function readIndexFromStream($stream, \DateTime $created = null): Index |
| 552 | 555 | { |
| 553 | 556 | if (!is_resource($stream)) |
@@ -585,6 +588,9 @@ discard block |
||
| 585 | 588 | return $path; |
| 586 | 589 | } |
| 587 | 590 | |
| 591 | + /** |
|
| 592 | + * @param resource $stream |
|
| 593 | + */ |
|
| 588 | 594 | protected function readSynchronizationListFromStream($stream): SynchronizationList |
| 589 | 595 | { |
| 590 | 596 | if (!is_resource($stream)) |
@@ -283,8 +283,7 @@ discard block |
||
| 283 | 283 | { |
| 284 | 284 | $newRevision = $newRevision ?: ($lastSynchronization->getRevision() + 1); |
| 285 | 285 | $remoteIndex = $this->doLoadRemoteIndex($lastSynchronization->getRevision(), $synchronizationList); |
| 286 | - } |
|
| 287 | - else |
|
| 286 | + } else |
|
| 288 | 287 | { |
| 289 | 288 | $newRevision = $newRevision ?: 1; |
| 290 | 289 | $remoteIndex = null; |
@@ -461,8 +460,7 @@ discard block |
||
| 461 | 460 | if ($localObject === null) |
| 462 | 461 | { |
| 463 | 462 | $operationCollection->addOperation(new MkdirOperation($absoluteLocalPath, $indexObject->getMode())); |
| 464 | - } |
|
| 465 | - elseif (!$localObject->isDirectory()) |
|
| 463 | + } elseif (!$localObject->isDirectory()) |
|
| 466 | 464 | { |
| 467 | 465 | $operationCollection->addOperation(new MkdirOperation($absoluteLocalPath, $indexObject->getMode())); |
| 468 | 466 | } |
@@ -474,9 +472,7 @@ discard block |
||
| 474 | 472 | $directoryMtimes[$absoluteLocalPath] = $indexObject->getMtime(); |
| 475 | 473 | } |
| 476 | 474 | } |
| 477 | - } |
|
| 478 | - |
|
| 479 | - elseif ($indexObject->isFile()) |
|
| 475 | + } elseif ($indexObject->isFile()) |
|
| 480 | 476 | { |
| 481 | 477 | // local file did not exist, hasn't been a file before or is outdated |
| 482 | 478 | if ($localObject === null || !$localObject->isFile() || $localObject->getMtime() < $indexObject->getMtime()) |
@@ -502,9 +498,7 @@ discard block |
||
| 502 | 498 | |
| 503 | 499 | $operationCollection->addOperation(new UploadOperation($absoluteLocalPath, $indexObject->getBlobId(), $this->vaultConnection, $uploadStreamFilters)); |
| 504 | 500 | } |
| 505 | - } |
|
| 506 | - |
|
| 507 | - elseif ($indexObject->isLink()) |
|
| 501 | + } elseif ($indexObject->isLink()) |
|
| 508 | 502 | { |
| 509 | 503 | $absoluteLinkTarget = dirname($absoluteLocalPath) . DIRECTORY_SEPARATOR . $indexObject->getLinkTarget(); |
| 510 | 504 | |
@@ -513,9 +507,7 @@ discard block |
||
| 513 | 507 | $operationCollection->addOperation(new UnlinkOperation($absoluteLocalPath)); |
| 514 | 508 | $operationCollection->addOperation(new SymlinkOperation($absoluteLocalPath, $absoluteLinkTarget, $indexObject->getMode())); |
| 515 | 509 | } |
| 516 | - } |
|
| 517 | - |
|
| 518 | - else |
|
| 510 | + } else |
|
| 519 | 511 | { |
| 520 | 512 | // unknown object type |
| 521 | 513 | throw new Exception(); |
@@ -110,8 +110,7 @@ |
||
| 110 | 110 | if (count($operationCollection)) |
| 111 | 111 | { |
| 112 | 112 | $output->writeln(sprintf('Current state: <bold>There are %d outstanding operations.</bold>', count($operationCollection))); |
| 113 | - } |
|
| 114 | - else |
|
| 113 | + } else |
|
| 115 | 114 | { |
| 116 | 115 | $output->writeln('Current state: <info>Everything is up to date!</info>'); |
| 117 | 116 | } |
@@ -46,8 +46,7 @@ |
||
| 46 | 46 | if ($input->getOption('config')) |
| 47 | 47 | { |
| 48 | 48 | $this->config = $reader->getConfiguration($input->getOption('config')); |
| 49 | - } |
|
| 50 | - elseif (is_file('archivr.json')) |
|
| 49 | + } elseif (is_file('archivr.json')) |
|
| 51 | 50 | { |
| 52 | 51 | $this->config = $reader->getConfiguration('archivr.json'); |
| 53 | 52 | } |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | class Application extends \Symfony\Component\Console\Application |
| 6 | 6 | { |
| 7 | - const LOGO = <<<TXT |
|
| 7 | + const LOGO = <<<TXT |
|
| 8 | 8 | ___ __ _ ___ |
| 9 | 9 | / _ | ________/ / (_) __/ _ \ |
| 10 | 10 | / __ |/ __/ __/ _ \/ / |/ / , _/ |