@@ -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); |
@@ -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 | } |
@@ -96,8 +96,7 @@ |
||
| 96 | 96 | |
| 97 | 97 | unset($this->lockDepthMap[$name]); |
| 98 | 98 | } |
| 99 | - } |
|
| 100 | - else |
|
| 99 | + } else |
|
| 101 | 100 | { |
| 102 | 101 | $this->logger->info("Requested lock release for non-hold lock '{$name}'. Doing nothing."); |
| 103 | 102 | } |
@@ -17,12 +17,10 @@ |
||
| 17 | 17 | if (!file_exists($path)) |
| 18 | 18 | { |
| 19 | 19 | throw new \InvalidArgumentException("Given path '{$path}' does not exist."); |
| 20 | - } |
|
| 21 | - elseif (!is_dir($path)) |
|
| 20 | + } elseif (!is_dir($path)) |
|
| 22 | 21 | { |
| 23 | 22 | throw new \InvalidArgumentException("Given path '{$path}' is not a directory."); |
| 24 | - } |
|
| 25 | - elseif (!is_readable($path)) |
|
| 23 | + } elseif (!is_readable($path)) |
|
| 26 | 24 | { |
| 27 | 25 | throw new \InvalidArgumentException("Given directory '{$path}' is not readable.'"); |
| 28 | 26 | } |