@@ -45,7 +45,7 @@ |
||
45 | 45 | |
46 | 46 | $this->consoleStyle->warning("Invalid choice"); |
47 | 47 | } |
48 | - while(true); |
|
48 | + while (true); |
|
49 | 49 | |
50 | 50 | return $return; |
51 | 51 | } |
@@ -46,8 +46,7 @@ discard block |
||
46 | 46 | if ('..' === $part) |
47 | 47 | { |
48 | 48 | array_pop($absolutePathParts); |
49 | - } |
|
50 | - else |
|
49 | + } else |
|
51 | 50 | { |
52 | 51 | $absolutePathParts[] = $part; |
53 | 52 | } |
@@ -58,8 +57,7 @@ discard block |
||
58 | 57 | if (substr($path, 0, 1) === '/') |
59 | 58 | { |
60 | 59 | return '/' . $return; |
61 | - } |
|
62 | - else |
|
60 | + } else |
|
63 | 61 | { |
64 | 62 | return getcwd() . '/' . $return; |
65 | 63 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | } |
155 | 155 | |
156 | 156 | /** |
157 | - * @param Vault[] $vaults |
|
157 | + * @param \Traversable $vaults |
|
158 | 158 | * @param string $lockName |
159 | 159 | */ |
160 | 160 | protected function acquireLocks(\Traversable $vaults, string $lockName) |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
172 | - * @param Vault[] $vaults |
|
172 | + * @param \Traversable $vaults |
|
173 | 173 | * @param string $lockName |
174 | 174 | */ |
175 | 175 | protected function releaseLocks(\Traversable $vaults, string $lockName) |
@@ -183,6 +183,10 @@ discard block |
||
183 | 183 | } |
184 | 184 | } |
185 | 185 | |
186 | + /** |
|
187 | + * @param null|integer $revision |
|
188 | + * @param null|string $vaultTitle |
|
189 | + */ |
|
186 | 190 | protected function getVaultForDownload(?int $revision, ?string $vaultTitle): ?Vault |
187 | 191 | { |
188 | 192 | $revision = $revision ?: $this->getLastRevision(); |
@@ -196,8 +196,7 @@ |
||
196 | 196 | if ($vaultTitle) |
197 | 197 | { |
198 | 198 | $vault = $vaultContainer->getVaultByTitle($vaultTitle); |
199 | - } |
|
200 | - else |
|
199 | + } else |
|
201 | 200 | { |
202 | 201 | $vaults = $vaultContainer->getVaultsHavingRevision($revision); |
203 | 202 | $vault = $vaultContainer->getPrioritizedVault($vaults); |
@@ -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 | } |
@@ -41,8 +41,7 @@ |
||
41 | 41 | if ($parentNode === null) |
42 | 42 | { |
43 | 43 | throw new Exception("Trying to add object {$indexObject->getRelativePath()} without existing parent node"); |
44 | - } |
|
45 | - elseif (!$parentNode->getIndexObject()->isDirectory()) |
|
44 | + } elseif (!$parentNode->getIndexObject()->isDirectory()) |
|
46 | 45 | { |
47 | 46 | throw new Exception("Trying to add object {$indexObject->getRelativePath()} under parent node which is not a directory"); |
48 | 47 | } |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | class Application extends \Symfony\Component\Console\Application |
6 | 6 | { |
7 | - public const LOGO = <<<TXT |
|
7 | + public const LOGO = <<<TXT |
|
8 | 8 | ____ _ |
9 | 9 | / ___|| |_ ___ _ __ ___ _ __ ___ __ _ _ __ |
10 | 10 | \___ \| __/ _ \| '__/ _ \ '_ ` _ \ / _` | '_ \ |
@@ -57,8 +57,7 @@ |
||
57 | 57 | /** @var Configuration $configuration */ |
58 | 58 | $configuration = new $className(); |
59 | 59 | $configuration->exchangeArray($array); |
60 | - } |
|
61 | - catch (\InvalidArgumentException $exception) |
|
60 | + } catch (\InvalidArgumentException $exception) |
|
62 | 61 | { |
63 | 62 | throw new ConfigurationException("In file {$configurationFilePath}", 0, $exception); |
64 | 63 | } |
@@ -205,8 +205,7 @@ |
||
205 | 205 | $vaultConfig = new $className($this); |
206 | 206 | $vaultConfig->exchangeArray($val); |
207 | 207 | } |
208 | - } |
|
209 | - else |
|
208 | + } else |
|
210 | 209 | { |
211 | 210 | // using setter to prevent skipping validation |
212 | 211 | call_user_func([$this, 'set' . ucfirst($key)], $value); |
@@ -46,8 +46,7 @@ discard block |
||
46 | 46 | { |
47 | 47 | throw new Exception(sprintf('writeStream() failed for %s.', $relativePath)); |
48 | 48 | } |
49 | - } |
|
50 | - catch (\Exception $exception) |
|
49 | + } catch (\Exception $exception) |
|
51 | 50 | { |
52 | 51 | throw new Exception($exception->getMessage(), 0, $exception); |
53 | 52 | } |
@@ -58,8 +57,7 @@ discard block |
||
58 | 57 | try |
59 | 58 | { |
60 | 59 | return $this->filesystem->has($relativePath); |
61 | - } |
|
62 | - catch (\Exception $exception) |
|
60 | + } catch (\Exception $exception) |
|
63 | 61 | { |
64 | 62 | throw new Exception($exception->getMessage(), 0, $exception); |
65 | 63 | } |
@@ -77,8 +75,7 @@ discard block |
||
77 | 75 | { |
78 | 76 | throw new Exception(sprintf('unlink() failed for %s', $relativePath)); |
79 | 77 | } |
80 | - } |
|
81 | - catch (\Exception $exception) |
|
78 | + } catch (\Exception $exception) |
|
82 | 79 | { |
83 | 80 | throw new Exception($exception->getMessage(), 0, $exception); |
84 | 81 | } |
@@ -98,8 +95,7 @@ discard block |
||
98 | 95 | } |
99 | 96 | |
100 | 97 | return $stream; |
101 | - } |
|
102 | - catch (\Exception $exception) |
|
98 | + } catch (\Exception $exception) |
|
103 | 99 | { |
104 | 100 | throw new Exception($exception->getMessage(), 0, $exception); |
105 | 101 | } |