Completed
Push — master ( 44a00f...9727c6 )
by Arne
02:20
created
src/IndexMerger/StandardIndexMerger.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -275,6 +275,10 @@
 block discarded – undo
275 275
         return $remoteObject->getBlobId() !== $lastLocalObject->getBlobId();
276 276
     }
277 277
 
278
+    /**
279
+     * @param IndexObject $localObject
280
+     * @param IndexObject $lastLocalObject
281
+     */
278 282
     protected function resolveConflict(ConflictHandlerInterface $conflictHandler, IndexObject $remoteObject, ?IndexObject $localObject, ?IndexObject $lastLocalObject): IndexObject
279 283
     {
280 284
         $this->logger->notice("Resolving conflict at {$remoteObject->getRelativePath()}...");
Please login to merge, or discard this patch.
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -100,38 +100,32 @@  discard block
 block discarded – undo
100 100
         {
101 101
             // locally and remotely deleted
102 102
             return null;
103
-        }
104
-        elseif ($lastLocalObject === null)
103
+        } elseif ($lastLocalObject === null)
105 104
         {
106 105
             if ($remoteObject === null)
107 106
             {
108 107
                 // locally created
109 108
                 return clone $localObject;
110
-            }
111
-            elseif ($localObject === null)
109
+            } elseif ($localObject === null)
112 110
             {
113 111
                 // remotely created
114 112
                 return clone $remoteObject;
115
-            }
116
-            elseif ($remoteObject !== null && $localObject !== null)
113
+            } elseif ($remoteObject !== null && $localObject !== null)
117 114
             {
118 115
                 // remotely and locally created
119 116
                 return $this->resolveConflict($conflictHandler, $remoteObject, $localObject, $lastLocalObject);
120 117
             }
121
-        }
122
-        elseif ($remoteObject === null)
118
+        } elseif ($remoteObject === null)
123 119
         {
124 120
             // remotely deleted and locally changed
125 121
             return $this->resolveConflict($conflictHandler, $remoteObject, $localObject, $lastLocalObject);
126
-        }
127
-        elseif ($localObject === null)
122
+        } elseif ($localObject === null)
128 123
         {
129 124
             if ($remoteObject->equals($lastLocalObject))
130 125
             {
131 126
                 // locally deleted
132 127
                 return null;
133
-            }
134
-            else
128
+            } else
135 129
             {
136 130
                 // remotely changed and locally deleted
137 131
                 return $this->resolveConflict($conflictHandler, $remoteObject, $localObject, $lastLocalObject);
@@ -183,8 +177,7 @@  discard block
 block discarded – undo
183 177
             if ($modifiedRemote || !$modifiedLocal)
184 178
             {
185 179
                 $attributes[$attribute] = $remoteObject[$attribute];
186
-            }
187
-            else
180
+            } else
188 181
             {
189 182
                 $attributes[$attribute] = $localObject[$attribute];
190 183
             }
@@ -210,8 +203,7 @@  discard block
 block discarded – undo
210 203
                 $attributes['size'] = $remoteObject->getSize();
211 204
                 $attributes['blobId'] = $remoteObject->getBlobId();
212 205
                 $attributes['hashes'] = clone $remoteObject->getHashes();
213
-            }
214
-            else
206
+            } else
215 207
             {
216 208
                 $attributes['size'] = $localObject->getSize();
217 209
                 $attributes['inode'] = $localObject->getInode();
Please login to merge, or discard this patch.
src/OperationListBuilder/StandardOperationListBuilder.php 1 patch
Braces   +3 added lines, -9 removed lines patch added patch discarded remove patch
@@ -63,9 +63,7 @@  discard block
 block discarded – undo
63 63
                         $toSetMtime[$mergedIndexObject->getRelativePath()] = $mergedIndexObject;
64 64
                     }
65 65
                 }
66
-            }
67
-
68
-            elseif ($mergedIndexObject->isFile())
66
+            } elseif ($mergedIndexObject->isFile())
69 67
             {
70 68
                 // local file did not exist, hasn't been a file before or has outdated content
71 69
                 $doDownloadFile = $localObject === null || !$localObject->isFile() || $mergedIndexObject->getBlobId() !== $localObject->getBlobId();
@@ -78,9 +76,7 @@  discard block
 block discarded – undo
78 76
 
79 77
                     $modifiedPaths[] = $mergedIndexObject->getRelativePath();
80 78
                 }
81
-            }
82
-
83
-            elseif ($mergedIndexObject->isLink())
79
+            } elseif ($mergedIndexObject->isLink())
84 80
             {
85 81
                 if ($localObject !== null && $localObject->getLinkTarget() !== $mergedIndexObject->getLinkTarget())
86 82
                 {
@@ -89,9 +85,7 @@  discard block
 block discarded – undo
89 85
 
90 86
                     $modifiedPaths[] = $mergedIndexObject->getRelativePath();
91 87
                 }
92
-            }
93
-
94
-            else
88
+            } else
95 89
             {
96 90
                 // unknown/invalid object type
97 91
                 throw new Exception();
Please login to merge, or discard this patch.
src/Index/IndexObject.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -284,8 +284,7 @@
 block discarded – undo
284 284
                 "size: {$this->size} B",
285 285
                 "blobId: {$blobId}",
286 286
             ]);
287
-        }
288
-        elseif ($this->isLink())
287
+        } elseif ($this->isLink())
289 288
         {
290 289
             $parts = array_merge($parts, [
291 290
                 "target: {$this->linkTarget}",
Please login to merge, or discard this patch.