@@ -80,7 +80,7 @@ |
||
| 80 | 80 | */ |
| 81 | 81 | public function runCommand(string $command) : RedisCli |
| 82 | 82 | { |
| 83 | - if(!isset($this->availableCommands[$command])) { |
|
| 83 | + if (!isset($this->availableCommands[$command])) { |
|
| 84 | 84 | throw new Exception('Unknown redis-cli command'); |
| 85 | 85 | } |
| 86 | 86 | $this->command = $command; |
@@ -173,7 +173,7 @@ |
||
| 173 | 173 | $tar = new Cmd($this->binary); |
| 174 | 174 | |
| 175 | 175 | $tar->addOptionIfNotEmpty('--ignore-failed-read', $this->ignoreFailedRead, false); |
| 176 | - $tar->addOption('-' . $this->compression . 'cf'); |
|
| 176 | + $tar->addOption('-'.$this->compression.'cf'); |
|
| 177 | 177 | $tar->addArgument($this->tarPathname); |
| 178 | 178 | $tar->addOption('-C', dirname($this->path), ' '); |
| 179 | 179 | $tar->addArgument(basename($this->path)); |
@@ -453,8 +453,8 @@ |
||
| 453 | 453 | protected function createCommandLine() : CommandLine |
| 454 | 454 | { |
| 455 | 455 | $process = new CommandLine(); |
| 456 | - $password = $this->password ? 'PGPASSWORD=' . escapeshellarg($this->password) . ' ' : ''; |
|
| 457 | - $cmd = new Cmd($password . $this->binary); |
|
| 456 | + $password = $this->password ? 'PGPASSWORD='.escapeshellarg($this->password).' ' : ''; |
|
| 457 | + $cmd = new Cmd($password.$this->binary); |
|
| 458 | 458 | $process->addCommand($cmd); |
| 459 | 459 | |
| 460 | 460 | // always disable password prompt |
@@ -102,9 +102,9 @@ |
||
| 102 | 102 | if (!empty($this->host)) { |
| 103 | 103 | // remote user |
| 104 | 104 | if (!empty($this->user)) { |
| 105 | - $return .= $this->user . '@'; |
|
| 105 | + $return .= $this->user.'@'; |
|
| 106 | 106 | } |
| 107 | - $return .= $this->host . ':'; |
|
| 107 | + $return .= $this->host.':'; |
|
| 108 | 108 | } |
| 109 | 109 | $return .= $this->path; |
| 110 | 110 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | $ret = self::EXIT_EXCEPTION; |
| 111 | 111 | } |
| 112 | 112 | } catch (\Exception $e) { |
| 113 | - echo $e->getMessage() . PHP_EOL; |
|
| 113 | + echo $e->getMessage().PHP_EOL; |
|
| 114 | 114 | $ret = self::EXIT_EXCEPTION; |
| 115 | 115 | } |
| 116 | 116 | |
@@ -218,12 +218,12 @@ discard block |
||
| 218 | 218 | */ |
| 219 | 219 | protected function findConfigurationInDir() |
| 220 | 220 | { |
| 221 | - $configurationFile = $this->arguments['configuration'] . '/phpbu.xml'; |
|
| 221 | + $configurationFile = $this->arguments['configuration'].'/phpbu.xml'; |
|
| 222 | 222 | |
| 223 | 223 | if (file_exists($configurationFile)) { |
| 224 | 224 | $this->arguments['configuration'] = realpath($configurationFile); |
| 225 | - } elseif (file_exists($configurationFile . '.dist')) { |
|
| 226 | - $this->arguments['configuration'] = realpath($configurationFile . '.dist'); |
|
| 225 | + } elseif (file_exists($configurationFile.'.dist')) { |
|
| 226 | + $this->arguments['configuration'] = realpath($configurationFile.'.dist'); |
|
| 227 | 227 | } |
| 228 | 228 | } |
| 229 | 229 | |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | { |
| 285 | 285 | $value = Arr::getValue($this->arguments, $arg); |
| 286 | 286 | if (!empty($value)) { |
| 287 | - $setter = 'set' . ucfirst($arg); |
|
| 287 | + $setter = 'set'.ucfirst($arg); |
|
| 288 | 288 | $configuration->{$setter}($value); |
| 289 | 289 | } |
| 290 | 290 | } |
@@ -298,13 +298,13 @@ discard block |
||
| 298 | 298 | |
| 299 | 299 | // check if upgrade is necessary |
| 300 | 300 | if (!$this->isPharOutdated($this->getLatestVersion())) { |
| 301 | - echo 'You already have the latest version of phpbu installed.' . PHP_EOL; |
|
| 301 | + echo 'You already have the latest version of phpbu installed.'.PHP_EOL; |
|
| 302 | 302 | exit(self::EXIT_SUCCESS); |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | $remoteFilename = 'http://phar.phpbu.de/phpbu.phar'; |
| 306 | 306 | $localFilename = realpath($_SERVER['argv'][0]); |
| 307 | - $tempFilename = basename($localFilename, '.phar') . '-temp.phar'; |
|
| 307 | + $tempFilename = basename($localFilename, '.phar').'-temp.phar'; |
|
| 308 | 308 | |
| 309 | 309 | echo 'Updating the phpbu PHAR ... '; |
| 310 | 310 | |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | $phar = file_get_contents($remoteFilename); |
| 313 | 313 | error_reporting($old); |
| 314 | 314 | if (!$phar) { |
| 315 | - echo ' failed' . PHP_EOL . 'Could not reach phpbu update site' . PHP_EOL; |
|
| 315 | + echo ' failed'.PHP_EOL.'Could not reach phpbu update site'.PHP_EOL; |
|
| 316 | 316 | exit(self::EXIT_EXCEPTION); |
| 317 | 317 | } |
| 318 | 318 | file_put_contents($tempFilename, $phar); |
@@ -328,11 +328,11 @@ discard block |
||
| 328 | 328 | } catch (Exception $e) { |
| 329 | 329 | // cleanup crappy phar |
| 330 | 330 | unlink($tempFilename); |
| 331 | - echo 'failed' . PHP_EOL . $e->getMessage() . PHP_EOL; |
|
| 331 | + echo 'failed'.PHP_EOL.$e->getMessage().PHP_EOL; |
|
| 332 | 332 | exit(self::EXIT_EXCEPTION); |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | - echo 'done' . PHP_EOL; |
|
| 335 | + echo 'done'.PHP_EOL; |
|
| 336 | 336 | exit(self::EXIT_SUCCESS); |
| 337 | 337 | } |
| 338 | 338 | |
@@ -345,10 +345,10 @@ discard block |
||
| 345 | 345 | |
| 346 | 346 | $latestVersion = $this->getLatestVersion(); |
| 347 | 347 | if ($this->isPharOutdated($latestVersion)) { |
| 348 | - print 'You are not using the latest version of phpbu.' . PHP_EOL |
|
| 349 | - . 'Use "phpunit --self-upgrade" to install phpbu ' . $latestVersion . PHP_EOL; |
|
| 348 | + print 'You are not using the latest version of phpbu.'.PHP_EOL |
|
| 349 | + . 'Use "phpunit --self-upgrade" to install phpbu '.$latestVersion.PHP_EOL; |
|
| 350 | 350 | } else { |
| 351 | - print 'You are using the latest version of phpbu.' . PHP_EOL; |
|
| 351 | + print 'You are using the latest version of phpbu.'.PHP_EOL; |
|
| 352 | 352 | } |
| 353 | 353 | exit(self::EXIT_SUCCESS); |
| 354 | 354 | } |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | $version = file_get_contents('https://phar.phpbu.de/latest-version-of/phpbu'); |
| 366 | 366 | error_reporting($old); |
| 367 | 367 | if (!$version) { |
| 368 | - echo 'Network-Error: Could not check latest version.' . PHP_EOL; |
|
| 368 | + echo 'Network-Error: Could not check latest version.'.PHP_EOL; |
|
| 369 | 369 | exit(self::EXIT_EXCEPTION); |
| 370 | 370 | } |
| 371 | 371 | return $version; |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | return; |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | - echo Version::getVersionString() . PHP_EOL . PHP_EOL; |
|
| 394 | + echo Version::getVersionString().PHP_EOL.PHP_EOL; |
|
| 395 | 395 | $this->isVersionStringPrinted = true; |
| 396 | 396 | } |
| 397 | 397 | |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | */ |
| 401 | 401 | protected function printLogo() |
| 402 | 402 | { |
| 403 | - echo self::$logo . PHP_EOL; |
|
| 403 | + echo self::$logo.PHP_EOL; |
|
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | /** |
@@ -424,8 +424,8 @@ discard block |
||
| 424 | 424 | |
| 425 | 425 | EOT; |
| 426 | 426 | if ($this->isPhar) { |
| 427 | - echo ' --version-check Check whether phpbu is the latest version.' . PHP_EOL; |
|
| 428 | - echo ' --self-upgrade Upgrade phpbu to the latest version.' . PHP_EOL; |
|
| 427 | + echo ' --version-check Check whether phpbu is the latest version.'.PHP_EOL; |
|
| 428 | + echo ' --self-upgrade Upgrade phpbu to the latest version.'.PHP_EOL; |
|
| 429 | 429 | } |
| 430 | 430 | } |
| 431 | 431 | |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | { |
| 440 | 440 | $help = $hint ? ', use "phpbu -h" for help' : ''; |
| 441 | 441 | $this->printVersionString(); |
| 442 | - echo $message . $help . PHP_EOL; |
|
| 442 | + echo $message.$help.PHP_EOL; |
|
| 443 | 443 | exit(self::EXIT_EXCEPTION); |
| 444 | 444 | } |
| 445 | 445 | |
@@ -422,7 +422,7 @@ |
||
| 422 | 422 | -v, --verbose Output more verbose information. |
| 423 | 423 | -V, --version Output version information and exit. |
| 424 | 424 | |
| 425 | -EOT; |
|
| 425 | +eot; |
|
| 426 | 426 | if ($this->isPhar) { |
| 427 | 427 | echo ' --version-check Check whether phpbu is the latest version.' . PHP_EOL; |
| 428 | 428 | echo ' --self-upgrade Upgrade phpbu to the latest version.' . PHP_EOL; |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | */ |
| 40 | 40 | public function __construct(Runner $runner = null) |
| 41 | 41 | { |
| 42 | - $this->runner = $runner ? : new Runner\Simple(); |
|
| 42 | + $this->runner = $runner ?: new Runner\Simple(); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -105,10 +105,10 @@ |
||
| 105 | 105 | $executable->useSSLCert($this->certFile); |
| 106 | 106 | } else { |
| 107 | 107 | $executable->usePassword($this->password) |
| 108 | - ->encodeBase64(true); |
|
| 108 | + ->encodeBase64(true); |
|
| 109 | 109 | } |
| 110 | 110 | $executable->useAlgorithm($this->algorithm) |
| 111 | - ->deleteUncrypted(!$this->keepUncrypted); |
|
| 111 | + ->deleteUncrypted(!$this->keepUncrypted); |
|
| 112 | 112 | return $executable; |
| 113 | 113 | } |
| 114 | 114 | } |
@@ -33,10 +33,10 @@ discard block |
||
| 33 | 33 | $crypt = $this->execute($target); |
| 34 | 34 | $name = strtolower(get_class($this)); |
| 35 | 35 | |
| 36 | - $result->debug($name . ':' . $this->getExecutable($target)->getCommandPrintable()); |
|
| 36 | + $result->debug($name.':'.$this->getExecutable($target)->getCommandPrintable()); |
|
| 37 | 37 | |
| 38 | 38 | if (!$crypt->isSuccessful()) { |
| 39 | - throw new Exception($name . ' failed:' . PHP_EOL . $crypt->getStdErr()); |
|
| 39 | + throw new Exception($name.' failed:'.PHP_EOL.$crypt->getStdErr()); |
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | public function simulate(Target $target, Result $result) |
| 50 | 50 | { |
| 51 | 51 | $result->debug( |
| 52 | - 'execute encryption:' . PHP_EOL . |
|
| 52 | + 'execute encryption:'.PHP_EOL. |
|
| 53 | 53 | $this->getExecutable($target)->getCommandPrintable() |
| 54 | 54 | ); |
| 55 | 55 | } |
@@ -115,12 +115,12 @@ |
||
| 115 | 115 | { |
| 116 | 116 | $executable = new Executable\Mcrypt((string)$this->pathToMcrypt); |
| 117 | 117 | $executable->useAlgorithm($this->algorithm) |
| 118 | - ->useKey($this->key) |
|
| 119 | - ->useKeyFile($this->keyFile) |
|
| 120 | - ->useConfig($this->config) |
|
| 121 | - ->useHash($this->hash) |
|
| 122 | - ->saveAt($target->getPathname()) |
|
| 123 | - ->deleteUncrypted(!$this->keepUncrypted); |
|
| 118 | + ->useKey($this->key) |
|
| 119 | + ->useKeyFile($this->keyFile) |
|
| 120 | + ->useConfig($this->config) |
|
| 121 | + ->useHash($this->hash) |
|
| 122 | + ->saveAt($target->getPathname()) |
|
| 123 | + ->deleteUncrypted(!$this->keepUncrypted); |
|
| 124 | 124 | return $executable; |
| 125 | 125 | } |
| 126 | 126 | } |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | */ |
| 114 | 114 | protected function createExecutable(Target $target) : Executable |
| 115 | 115 | { |
| 116 | - $executable = new Executable\Mcrypt((string)$this->pathToMcrypt); |
|
| 116 | + $executable = new Executable\Mcrypt((string) $this->pathToMcrypt); |
|
| 117 | 117 | $executable->useAlgorithm($this->algorithm) |
| 118 | 118 | ->useKey($this->key) |
| 119 | 119 | ->useKeyFile($this->keyFile) |