@@ -29,8 +29,7 @@ |
||
| 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 | } |
@@ -38,8 +38,7 @@ |
||
| 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 | } |
@@ -89,9 +89,7 @@ |
||
| 89 | 89 | // compare remote object to object state at last sync |
| 90 | 90 | // we explicitly want to use equality instead of identity |
| 91 | 91 | $remoteObjectModified = !($remoteObject == $lastLocalObject); |
| 92 | - } |
|
| 93 | - |
|
| 94 | - else |
|
| 92 | + } else |
|
| 95 | 93 | { |
| 96 | 94 | // object already didn't exist locally at the last sync |
| 97 | 95 | $localObjectModified = false; |
@@ -68,9 +68,7 @@ discard block |
||
| 68 | 68 | $directoryMtimes[$mergedIndexObject->getRelativePath()] = $mergedIndexObject->getMtime(); |
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | - } |
|
| 72 | - |
|
| 73 | - elseif ($mergedIndexObject->isFile()) |
|
| 71 | + } elseif ($mergedIndexObject->isFile()) |
|
| 74 | 72 | { |
| 75 | 73 | // local file did not exist, hasn't been a file before or is outdated |
| 76 | 74 | $doDownloadFile = $localObject === null || !$localObject->isFile() || $localObject->getMtime() < $mergedIndexObject->getMtime(); |
@@ -98,9 +96,7 @@ discard block |
||
| 98 | 96 | |
| 99 | 97 | $operationList->addOperation(new UploadOperation($mergedIndexObject->getRelativePath(), $mergedIndexObject->getBlobId(), $uploadStreamFilters)); |
| 100 | 98 | } |
| 101 | - } |
|
| 102 | - |
|
| 103 | - elseif ($mergedIndexObject->isLink()) |
|
| 99 | + } elseif ($mergedIndexObject->isLink()) |
|
| 104 | 100 | { |
| 105 | 101 | if ($localObject !== null && $localObject->getLinkTarget() !== $mergedIndexObject->getLinkTarget()) |
| 106 | 102 | { |
@@ -109,9 +105,7 @@ discard block |
||
| 109 | 105 | |
| 110 | 106 | $modifiedPaths[] = $mergedIndexObject->getRelativePath(); |
| 111 | 107 | } |
| 112 | - } |
|
| 113 | - |
|
| 114 | - else |
|
| 108 | + } else |
|
| 115 | 109 | { |
| 116 | 110 | // unknown/invalid object type |
| 117 | 111 | throw new Exception(); |
@@ -106,12 +106,10 @@ discard block |
||
| 106 | 106 | if (is_string($token)) |
| 107 | 107 | { |
| 108 | 108 | $output .= $token; |
| 109 | - } |
|
| 110 | - elseif (in_array($token[0], [T_COMMENT, T_DOC_COMMENT])) |
|
| 109 | + } elseif (in_array($token[0], [T_COMMENT, T_DOC_COMMENT])) |
|
| 111 | 110 | { |
| 112 | 111 | $output .= str_repeat("\n", substr_count($token[1], "\n")); |
| 113 | - } |
|
| 114 | - elseif (T_WHITESPACE === $token[0]) |
|
| 112 | + } elseif (T_WHITESPACE === $token[0]) |
|
| 115 | 113 | { |
| 116 | 114 | // reduce wide spaces |
| 117 | 115 | $whitespace = preg_replace('{[ \t]+}', ' ', $token[1]); |
@@ -123,8 +121,7 @@ discard block |
||
| 123 | 121 | $whitespace = preg_replace('{\n +}', "\n", $whitespace); |
| 124 | 122 | |
| 125 | 123 | $output .= $whitespace; |
| 126 | - } |
|
| 127 | - else |
|
| 124 | + } else |
|
| 128 | 125 | { |
| 129 | 126 | $output .= $token[1]; |
| 130 | 127 | } |
@@ -292,8 +292,7 @@ |
||
| 292 | 292 | { |
| 293 | 293 | $newRevision = $newRevision ?: ($lastSynchronization->getRevision() + 1); |
| 294 | 294 | $remoteIndex = $this->doLoadRemoteIndex($lastSynchronization->getRevision(), $synchronizationList); |
| 295 | - } |
|
| 296 | - else |
|
| 295 | + } else |
|
| 297 | 296 | { |
| 298 | 297 | $newRevision = $newRevision ?: 1; |
| 299 | 298 | $remoteIndex = null; |
@@ -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 | } |
@@ -88,8 +88,7 @@ |
||
| 88 | 88 | $configurationFileWriter->writeConfigurationFile($configuration, $configFilePath, $skipDefaults); |
| 89 | 89 | |
| 90 | 90 | $output->writeln("<info>Successfully written config file to {$configFilePath}</info>"); |
| 91 | - } |
|
| 92 | - else |
|
| 91 | + } else |
|
| 93 | 92 | { |
| 94 | 93 | $output->writeln("<comment>Aborted</comment>"); |
| 95 | 94 | } |
@@ -41,8 +41,7 @@ |
||
| 41 | 41 | { |
| 42 | 42 | $vaultConfiguration->setConflictHandler('preferLocal'); |
| 43 | 43 | } |
| 44 | - } |
|
| 45 | - elseif ($preferRemote) |
|
| 44 | + } elseif ($preferRemote) |
|
| 46 | 45 | { |
| 47 | 46 | foreach ($configuration->getVaults() as $vaultConfiguration) |
| 48 | 47 | { |