Completed
Push — master ( 2772d0...6dfb2a )
by Arne
01:41
created
src/Connection/StreamConnection.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -157,6 +157,9 @@
 block discarded – undo
157 157
         }
158 158
     }
159 159
 
160
+    /**
161
+     * @param string $relativePath
162
+     */
160 163
     protected function getAbsolutePath($relativePath): string
161 164
     {
162 165
         return $this->remotePath . ltrim($relativePath, DIRECTORY_SEPARATOR);
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -114,8 +114,7 @@
 block discarded – undo
114 114
         try
115 115
         {
116 116
             @fclose($this->getStream($relativePath, 'r'));
117
-        }
118
-        catch (\RuntimeException $exception)
117
+        } catch (\RuntimeException $exception)
119 118
         {
120 119
             return false;
121 120
         }
Please login to merge, or discard this patch.
src/Vault.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -319,6 +319,9 @@  discard block
 block discarded – undo
319 319
         return $operationCollection;
320 320
     }
321 321
 
322
+    /**
323
+     * @param resource $stream
324
+     */
322 325
     protected function readIndexFromStream($stream, \DateTime $created = null): Index
323 326
     {
324 327
         $index = new Index($created);
@@ -331,6 +334,9 @@  discard block
 block discarded – undo
331 334
         return $index;
332 335
     }
333 336
 
337
+    /**
338
+     * @param resource $stream
339
+     */
334 340
     protected function writeIndexToStream(Index $index, $stream)
335 341
     {
336 342
         foreach ($index as $object)
Please login to merge, or discard this patch.
Braces   +4 added lines, -11 removed lines patch added patch discarded remove patch
@@ -232,8 +232,7 @@  discard block
 block discarded – undo
232 232
                 if ($localObject === null)
233 233
                 {
234 234
                     $operationCollection->addOperation(new MkdirOperation($absoluteLocalPath, $indexObject->getMode()));
235
-                }
236
-                elseif (!$localObject->isDirectory())
235
+                } elseif (!$localObject->isDirectory())
237 236
                 {
238 237
                     $operationCollection->addOperation(new MkdirOperation($absoluteLocalPath, $indexObject->getMode()));
239 238
                 }
@@ -245,9 +244,7 @@  discard block
 block discarded – undo
245 244
                         $directoryMtimes[$absoluteLocalPath] = $indexObject->getMtime();
246 245
                     }
247 246
                 }
248
-            }
249
-
250
-            elseif ($indexObject->isFile())
247
+            } elseif ($indexObject->isFile())
251 248
             {
252 249
                 // local file did not exist, hasn't been a file before or is outdated
253 250
                 if ($localObject === null || !$localObject->isFile() || $localObject->getMtime() < $indexObject->getMtime())
@@ -273,9 +270,7 @@  discard block
 block discarded – undo
273 270
 
274 271
                     $operationCollection->addOperation(new UploadOperation($absoluteLocalPath, $indexObject->getBlobId(), $this->vaultConnection));
275 272
                 }
276
-            }
277
-
278
-            elseif ($indexObject->isLink())
273
+            } elseif ($indexObject->isLink())
279 274
             {
280 275
                 $absoluteLinkTarget = dirname($absoluteLocalPath) . DIRECTORY_SEPARATOR . $indexObject->getLinkTarget();
281 276
 
@@ -284,9 +279,7 @@  discard block
 block discarded – undo
284 279
                     $operationCollection->addOperation(new UnlinkOperation($absoluteLocalPath));
285 280
                     $operationCollection->addOperation(new SymlinkOperation($absoluteLocalPath, $absoluteLinkTarget, $indexObject->getMode()));
286 281
                 }
287
-            }
288
-
289
-            else
282
+            } else
290 283
             {
291 284
                 // unknown object type
292 285
                 throw new \RuntimeException();
Please login to merge, or discard this patch.
src/IndexObject.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -161,17 +161,14 @@
 block discarded – undo
161 161
         if (is_file($absolutePath))
162 162
         {
163 163
             $object->type = static::TYPE_FILE;
164
-        }
165
-        elseif (is_dir($absolutePath))
164
+        } elseif (is_dir($absolutePath))
166 165
         {
167 166
             $object->type = static::TYPE_DIR;
168
-        }
169
-        elseif (is_link($absolutePath))
167
+        } elseif (is_link($absolutePath))
170 168
         {
171 169
             $object->type = static::TYPE_LINK;
172 170
             $object->linkTarget = str_replace($basePath, '', readlink($absolutePath));
173
-        }
174
-        else
171
+        } else
175 172
         {
176 173
             throw new \InvalidArgumentException(sprintf('File %s does not exist!', $absolutePath));
177 174
         }
Please login to merge, or discard this patch.
src/Cli/Command/InfoCommand.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@
 block discarded – undo
26 26
         if (count($operationCollection))
27 27
         {
28 28
             $output->writeln(sprintf('<info>There are %d outstanding operations!</info>', count($operationCollection)));
29
-        }
30
-        else
29
+        } else
31 30
         {
32 31
             $output->writeln('<info>Everything is up to date!</info>');
33 32
         }
Please login to merge, or discard this patch.
src/Index.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,8 +37,7 @@
 block discarded – undo
37 37
             if ($parent === null)
38 38
             {
39 39
                 throw new \InvalidArgumentException();
40
-            }
41
-            elseif (!$parent->isDirectory())
40
+            } elseif (!$parent->isDirectory())
42 41
             {
43 42
                 throw new \InvalidArgumentException();
44 43
             }
Please login to merge, or discard this patch.
src/Cli/Command/AbstractCommand.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,8 +49,7 @@
 block discarded – undo
49 49
             $factory = new JsonFileConfigurationFactory($path);
50 50
 
51 51
             return $factory();
52
-        }
53
-        else
52
+        } else
54 53
         {
55 54
             throw new \InvalidArgumentException(sprintf('Don\'t know how to handle configuration given file %s.', $path));
56 55
         }
Please login to merge, or discard this patch.
src/IndexMerger/StandardIndexMerger.php 1 patch
Braces   +4 added lines, -10 removed lines patch added patch discarded remove patch
@@ -25,27 +25,21 @@
 block discarded – undo
25 25
                 if ($localObjectModified)
26 26
                 {
27 27
                     $mergedIndex->addObject($localObject);
28
-                }
29
-                elseif ($remoteIndex === null)
28
+                } elseif ($remoteIndex === null)
30 29
                 {
31 30
                     $mergedIndex->addObject($localObject);
32 31
                 }
33
-            }
34
-            else
32
+            } else
35 33
             {
36 34
                 $remoteObjectModified = $remoteObject->getMtime() > $lastLocalIndex->getCreated()->getTimestamp();
37 35
 
38 36
                 if (!$localObjectModified)
39 37
                 {
40 38
                     $mergedIndex->addObject($remoteObject);
41
-                }
42
-
43
-                elseif (!$remoteObjectModified)
39
+                } elseif (!$remoteObjectModified)
44 40
                 {
45 41
                     $mergedIndex->addObject($localObject);
46
-                }
47
-
48
-                else
42
+                } else
49 43
                 {
50 44
                     throw new \RuntimeException("Collision at path {$localObject->getRelativePath()}");
51 45
                 }
Please login to merge, or discard this patch.