Completed
Push — master ( 7b1e0a...f2b67d )
by Arne
01:35
created
src/IndexMerger/StandardIndexMerger.php 1 patch
Braces   +4 added lines, -10 removed lines patch added patch discarded remove patch
@@ -26,27 +26,21 @@
 block discarded – undo
26 26
                 if ($localObjectModified)
27 27
                 {
28 28
                     $mergedIndex->addObject($localObject);
29
-                }
30
-                elseif ($remoteIndex === null)
29
+                } elseif ($remoteIndex === null)
31 30
                 {
32 31
                     $mergedIndex->addObject($localObject);
33 32
                 }
34
-            }
35
-            else
33
+            } else
36 34
             {
37 35
                 $remoteObjectModified = $lastLocalIndex ? ($remoteObject->getMtime() > $lastLocalIndex->getCreated()->getTimestamp()) : false;
38 36
 
39 37
                 if (!$localObjectModified)
40 38
                 {
41 39
                     $mergedIndex->addObject($remoteObject);
42
-                }
43
-
44
-                elseif (!$remoteObjectModified)
40
+                } elseif (!$remoteObjectModified)
45 41
                 {
46 42
                     $mergedIndex->addObject($localObject);
47
-                }
48
-
49
-                else
43
+                } else
50 44
                 {
51 45
                     throw new Exception("Collision at path {$localObject->getRelativePath()}");
52 46
                 }
Please login to merge, or discard this patch.
src/ConnectionAdapter/FlysystemConnectionAdapter.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -29,8 +29,7 @@  discard block
 block discarded – undo
29 29
             {
30 30
                 throw new Exception(sprintf('read() failed for %s.', $relativePath));
31 31
             }
32
-        }
33
-        catch (FlysystemException $exception)
32
+        } catch (FlysystemException $exception)
34 33
         {
35 34
             throw new Exception($exception->getMessage(), 0, $exception);
36 35
         }
@@ -48,8 +47,7 @@  discard block
 block discarded – undo
48 47
             {
49 48
                 throw new Exception(sprintf('write() failed for %s.', $relativePath));
50 49
             }
51
-        }
52
-        catch (FlysystemException $exception)
50
+        } catch (FlysystemException $exception)
53 51
         {
54 52
             throw new Exception($exception->getMessage(), 0, $exception);
55 53
         }
@@ -65,8 +63,7 @@  discard block
 block discarded – undo
65 63
             {
66 64
                 throw new Exception(sprintf('writeStream() failed for %s.', $relativePath));
67 65
             }
68
-        }
69
-        catch (FlysystemException $exception)
66
+        } catch (FlysystemException $exception)
70 67
         {
71 68
             throw new Exception($exception->getMessage(), 0, $exception);
72 69
         }
@@ -77,8 +74,7 @@  discard block
 block discarded – undo
77 74
         try
78 75
         {
79 76
             return $this->filesystem->has($relativePath);
80
-        }
81
-        catch (FlysystemException $exception)
77
+        } catch (FlysystemException $exception)
82 78
         {
83 79
             throw new Exception($exception->getMessage(), 0, $exception);
84 80
         }
@@ -94,8 +90,7 @@  discard block
 block discarded – undo
94 90
             {
95 91
                 throw new Exception(sprintf('unlink() failed for %s', $relativePath));
96 92
             }
97
-        }
98
-        catch (FlysystemException $exception)
93
+        } catch (FlysystemException $exception)
99 94
         {
100 95
             throw new Exception($exception->getMessage(), 0, $exception);
101 96
         }
@@ -113,8 +108,7 @@  discard block
 block discarded – undo
113 108
             }
114 109
 
115 110
             return $stream;
116
-        }
117
-        catch (FlysystemException $exception)
111
+        } catch (FlysystemException $exception)
118 112
         {
119 113
             throw new Exception($exception->getMessage(), 0, $exception);
120 114
         }
Please login to merge, or discard this patch.
src/Operation/UploadOperation.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,8 +29,7 @@
 block discarded – undo
29 29
             fclose($localStream);
30 30
 
31 31
             return true;
32
-        }
33
-        catch (Exception $exception)
32
+        } catch (Exception $exception)
34 33
         {
35 34
             return false;
36 35
         }
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
@@ -157,17 +157,14 @@
 block discarded – undo
157 157
         if (is_file($absolutePath))
158 158
         {
159 159
             $object->type = static::TYPE_FILE;
160
-        }
161
-        elseif (is_dir($absolutePath))
160
+        } elseif (is_dir($absolutePath))
162 161
         {
163 162
             $object->type = static::TYPE_DIR;
164
-        }
165
-        elseif (is_link($absolutePath))
163
+        } elseif (is_link($absolutePath))
166 164
         {
167 165
             $object->type = static::TYPE_LINK;
168 166
             $object->linkTarget = str_replace($basePath, '', readlink($absolutePath));
169
-        }
170
-        else
167
+        } else
171 168
         {
172 169
             throw new Exception(sprintf('File %s does not exist!', $absolutePath));
173 170
         }
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
@@ -38,8 +38,7 @@
 block discarded – undo
38 38
             if ($parent === null)
39 39
             {
40 40
                 throw new Exception();
41
-            }
42
-            elseif (!$parent->isDirectory())
41
+            } elseif (!$parent->isDirectory())
43 42
             {
44 43
                 throw new Exception();
45 44
             }
Please login to merge, or discard this patch.
src/Vault.php 1 patch
Braces   +5 added lines, -13 removed lines patch added patch discarded remove patch
@@ -283,8 +283,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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();
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
@@ -110,8 +110,7 @@
 block discarded – undo
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
         }
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
@@ -46,8 +46,7 @@
 block discarded – undo
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
             }
Please login to merge, or discard this patch.