@@ -17,7 +17,6 @@ |
||
| 17 | 17 | * |
| 18 | 18 | * @param Index $mergedIndex |
| 19 | 19 | * @param Index $localIndex |
| 20 | - * @param Index|null $remoteIndex |
|
| 21 | 20 | * @return OperationList |
| 22 | 21 | */ |
| 23 | 22 | public function buildOperationList(Index $mergedIndex, Index $localIndex): OperationList; |
@@ -100,6 +100,10 @@ discard block |
||
| 100 | 100 | return $mergedIndex; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | + /** |
|
| 104 | + * @param IndexObject|null $localObject |
|
| 105 | + * @param IndexObject|null $lastLocalObject |
|
| 106 | + */ |
|
| 103 | 107 | protected function isLocalObjectModified(?IndexObject $localObject, ?IndexObject $lastLocalObject, int $options): bool |
| 104 | 108 | { |
| 105 | 109 | if (!$lastLocalObject) |
@@ -132,6 +136,10 @@ discard block |
||
| 132 | 136 | return $localObjectModified; |
| 133 | 137 | } |
| 134 | 138 | |
| 139 | + /** |
|
| 140 | + * @param IndexObject|null $remoteObject |
|
| 141 | + * @param IndexObject|null $lastLocalObject |
|
| 142 | + */ |
|
| 135 | 143 | protected function isRemoteObjectModified(?IndexObject $remoteObject, ?IndexObject $lastLocalObject): bool |
| 136 | 144 | { |
| 137 | 145 | if ($lastLocalObject) |
@@ -144,6 +152,10 @@ discard block |
||
| 144 | 152 | } |
| 145 | 153 | } |
| 146 | 154 | |
| 155 | + /** |
|
| 156 | + * @param IndexObject|null $localObject |
|
| 157 | + * @param IndexObject|null $lastLocalObject |
|
| 158 | + */ |
|
| 147 | 159 | protected function resolveConflict(ConflictHandlerInterface $conflictHandler, IndexObject $remoteObject, ?IndexObject $localObject, ?IndexObject $lastLocalObject): IndexObject |
| 148 | 160 | { |
| 149 | 161 | $this->logger->notice("Resolving conflict at {$remoteObject->getRelativePath()}..."); |
@@ -75,12 +75,10 @@ discard block |
||
| 75 | 75 | if ($localObjectModified && $remoteObjectModified) |
| 76 | 76 | { |
| 77 | 77 | $mergedIndex->addObject($this->resolveConflict($conflictHandler, $remoteObject, $localObject, $lastLocalObject)); |
| 78 | - } |
|
| 79 | - elseif ($localObjectModified && $localObject !== null) |
|
| 78 | + } elseif ($localObjectModified && $localObject !== null) |
|
| 80 | 79 | { |
| 81 | 80 | $mergedIndex->addObject($localObject); |
| 82 | - } |
|
| 83 | - elseif ($remoteObjectModified && $remoteObject !== null) |
|
| 81 | + } elseif ($remoteObjectModified && $remoteObject !== null) |
|
| 84 | 82 | { |
| 85 | 83 | $mergedIndex->addObject($remoteObject); |
| 86 | 84 | } |
@@ -137,8 +135,7 @@ discard block |
||
| 137 | 135 | if ($lastLocalObject) |
| 138 | 136 | { |
| 139 | 137 | return !$lastLocalObject->equals($remoteObject, IndexObject::CMP_IGNORE_BLOBID | IndexObject::CMP_IGNORE_INODE); |
| 140 | - } |
|
| 141 | - else |
|
| 138 | + } else |
|
| 142 | 139 | { |
| 143 | 140 | return $remoteObject !== null; |
| 144 | 141 | } |
@@ -35,12 +35,10 @@ |
||
| 35 | 35 | if ($indexObjectA instanceof IndexObject) |
| 36 | 36 | { |
| 37 | 37 | $this->relativePath = $indexObjectA->getRelativePath(); |
| 38 | - } |
|
| 39 | - elseif ($indexObjectB instanceof IndexObject) |
|
| 38 | + } elseif ($indexObjectB instanceof IndexObject) |
|
| 40 | 39 | { |
| 41 | 40 | $this->relativePath = $indexObjectB->getRelativePath(); |
| 42 | - } |
|
| 43 | - else |
|
| 41 | + } else |
|
| 44 | 42 | { |
| 45 | 43 | throw new \LogicException(); |
| 46 | 44 | } |
@@ -233,8 +233,7 @@ |
||
| 233 | 233 | "size: {$this->size}", |
| 234 | 234 | "blobId: {$blobId}", |
| 235 | 235 | ]); |
| 236 | - } |
|
| 237 | - elseif ($this->isLink()) |
|
| 236 | + } elseif ($this->isLink()) |
|
| 238 | 237 | { |
| 239 | 238 | $parts = array_merge($parts, [ |
| 240 | 239 | "target: {$this->linkTarget}", |
@@ -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 | |
@@ -57,12 +57,10 @@ discard block |
||
| 57 | 57 | $this->consoleStyle->error("Invalid argument compareTo given."); |
| 58 | 58 | |
| 59 | 59 | return 1; |
| 60 | - } |
|
| 61 | - elseif ($compareTo === null) |
|
| 60 | + } elseif ($compareTo === null) |
|
| 62 | 61 | { |
| 63 | 62 | $compareToIndex = $storeman->getLocalIndex(); |
| 64 | - } |
|
| 65 | - else |
|
| 63 | + } else |
|
| 66 | 64 | { |
| 67 | 65 | $vault = $vaults->getPrioritizedVault($vaults->getVaultsHavingRevision($compareTo)); |
| 68 | 66 | |
@@ -101,9 +99,7 @@ discard block |
||
| 101 | 99 | $table->render(); |
| 102 | 100 | |
| 103 | 101 | $output->write("\n"); |
| 104 | - } |
|
| 105 | - |
|
| 106 | - else |
|
| 102 | + } else |
|
| 107 | 103 | { |
| 108 | 104 | $output->writeln("No differences found."); |
| 109 | 105 | } |
@@ -34,16 +34,13 @@ |
||
| 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 | |