@@ -45,7 +45,7 @@ |
||
45 | 45 | |
46 | 46 | $started = time(); |
47 | 47 | |
48 | - while(true) |
|
48 | + while (true) |
|
49 | 49 | { |
50 | 50 | $this->logger->debug("Checking lock existence for '{$name}'..."); |
51 | 51 |
@@ -172,8 +172,7 @@ |
||
172 | 172 | $this->logger->info(sprintf("Loading %s remote index...", $revision ? "r{$revision}" : 'latest')); |
173 | 173 | |
174 | 174 | $synchronization = $revision ? |
175 | - $this->getVaultLayout()->getSynchronization($revision) : |
|
176 | - $this->getVaultLayout()->getLastSynchronization(); |
|
175 | + $this->getVaultLayout()->getSynchronization($revision) : $this->getVaultLayout()->getLastSynchronization(); |
|
177 | 176 | |
178 | 177 | return $synchronization ? $synchronization->getIndex() : null; |
179 | 178 | } |
@@ -148,8 +148,7 @@ discard block |
||
148 | 148 | fclose($stream); |
149 | 149 | |
150 | 150 | $this->logger->info("Read {$index->count()} records for last local index"); |
151 | - } |
|
152 | - else |
|
151 | + } else |
|
153 | 152 | { |
154 | 153 | $this->logger->info("No last local index exists"); |
155 | 154 | } |
@@ -239,8 +238,7 @@ discard block |
||
239 | 238 | { |
240 | 239 | $newRevision = $newRevision ?: ($lastSynchronization->getRevision() + 1); |
241 | 240 | $remoteIndex = $lastSynchronization->getIndex(); |
242 | - } |
|
243 | - else |
|
241 | + } else |
|
244 | 242 | { |
245 | 243 | $newRevision = $newRevision ?: 1; |
246 | 244 | $remoteIndex = null; |
@@ -40,8 +40,7 @@ |
||
40 | 40 | { |
41 | 41 | $configuration = new Configuration(); |
42 | 42 | $configuration->exchangeArray($array); |
43 | - } |
|
44 | - catch (\InvalidArgumentException $exception) |
|
43 | + } catch (\InvalidArgumentException $exception) |
|
45 | 44 | { |
46 | 45 | throw new ConfigurationException("In file {$configurationFilePath}", 0, $exception); |
47 | 46 | } |
@@ -229,8 +229,7 @@ |
||
229 | 229 | $vaultConfig = new VaultConfiguration($this); |
230 | 230 | $vaultConfig->exchangeArray($val); |
231 | 231 | } |
232 | - } |
|
233 | - else |
|
232 | + } else |
|
234 | 233 | { |
235 | 234 | // using setter to prevent skipping validation |
236 | 235 | call_user_func([$this, 'set' . ucfirst($key)], $value); |
@@ -60,9 +60,7 @@ discard block |
||
60 | 60 | $directoryMtimes[$mergedIndexObject->getRelativePath()] = $mergedIndexObject->getMtime(); |
61 | 61 | } |
62 | 62 | } |
63 | - } |
|
64 | - |
|
65 | - elseif ($mergedIndexObject->isFile()) |
|
63 | + } elseif ($mergedIndexObject->isFile()) |
|
66 | 64 | { |
67 | 65 | // local file did not exist, hasn't been a file before or has outdated content |
68 | 66 | $doDownloadFile = $localObject === null || !$localObject->isFile() || $mergedIndexObject->getBlobId() !== $localObject->getBlobId(); |
@@ -75,9 +73,7 @@ discard block |
||
75 | 73 | |
76 | 74 | $modifiedPaths[] = $mergedIndexObject->getRelativePath(); |
77 | 75 | } |
78 | - } |
|
79 | - |
|
80 | - elseif ($mergedIndexObject->isLink()) |
|
76 | + } elseif ($mergedIndexObject->isLink()) |
|
81 | 77 | { |
82 | 78 | if ($localObject !== null && $localObject->getLinkTarget() !== $mergedIndexObject->getLinkTarget()) |
83 | 79 | { |
@@ -86,9 +82,7 @@ discard block |
||
86 | 82 | |
87 | 83 | $modifiedPaths[] = $mergedIndexObject->getRelativePath(); |
88 | 84 | } |
89 | - } |
|
90 | - |
|
91 | - else |
|
85 | + } else |
|
92 | 86 | { |
93 | 87 | // unknown/invalid object type |
94 | 88 | throw new Exception(); |
@@ -34,16 +34,13 @@ discard block |
||
34 | 34 | |
35 | 35 | return 0; |
36 | 36 | } |
37 | - } |
|
38 | - elseif ($revision === 'local') |
|
37 | + } elseif ($revision === 'local') |
|
39 | 38 | { |
40 | 39 | $index = $storeman->getLocalIndex(); |
41 | - } |
|
42 | - elseif (ctype_digit($revision)) |
|
40 | + } elseif (ctype_digit($revision)) |
|
43 | 41 | { |
44 | 42 | $revision = intval($revision); |
45 | - } |
|
46 | - else |
|
43 | + } else |
|
47 | 44 | { |
48 | 45 | $this->consoleStyle->error("Argument 'revision' invalid."); |
49 | 46 | |
@@ -72,8 +69,7 @@ discard block |
||
72 | 69 | /** @var DisplayIndexHelper $displayIndexHelper */ |
73 | 70 | $displayIndexHelper = $this->getHelper('displayIndex'); |
74 | 71 | $displayIndexHelper->displayIndex($index, $output); |
75 | - } |
|
76 | - else |
|
72 | + } else |
|
77 | 73 | { |
78 | 74 | $this->consoleStyle->writeln("(Empty index)"); |
79 | 75 | } |
@@ -56,12 +56,10 @@ discard block |
||
56 | 56 | $this->consoleStyle->error("Invalid argument compareTo given."); |
57 | 57 | |
58 | 58 | return 1; |
59 | - } |
|
60 | - elseif ($compareTo === null) |
|
59 | + } elseif ($compareTo === null) |
|
61 | 60 | { |
62 | 61 | $compareToIndex = $storeman->getLocalIndex(); |
63 | - } |
|
64 | - else |
|
62 | + } else |
|
65 | 63 | { |
66 | 64 | $vault = $vaults->getPrioritizedVault($vaults->getVaultsHavingRevision($compareTo)); |
67 | 65 | |
@@ -88,9 +86,7 @@ discard block |
||
88 | 86 | /** @var DisplayIndexComparisonHelper $helper */ |
89 | 87 | $helper = $this->getHelper('displayIndexComparison'); |
90 | 88 | $helper->displayIndexComparison($diff, $output, "r{$revision}", $compareTo ? "r{$compareTo}" : "local"); |
91 | - } |
|
92 | - |
|
93 | - else |
|
89 | + } else |
|
94 | 90 | { |
95 | 91 | $output->writeln("No differences found."); |
96 | 92 | } |
@@ -59,8 +59,7 @@ |
||
59 | 59 | "blobId: " . ($indexObject->getBlobId() ?: '-'), |
60 | 60 | "hash(es):" . ($indexObject->getHashes() && $indexObject->getHashes()->count() ? ("\n" . str_replace(', ', "\n", $indexObject->getHashes()->__toString())) : ' -'), |
61 | 61 | ]); |
62 | - } |
|
63 | - elseif ($indexObject->isLink()) |
|
62 | + } elseif ($indexObject->isLink()) |
|
64 | 63 | { |
65 | 64 | $parts = array_merge($parts, [ |
66 | 65 | "target: {$indexObject->getLinkTarget()}" |