@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $ret = self::EXIT_EXCEPTION; |
98 | 98 | } |
99 | 99 | } catch (\Exception $e) { |
100 | - echo $e->getMessage() . PHP_EOL; |
|
100 | + echo $e->getMessage().PHP_EOL; |
|
101 | 101 | $ret = self::EXIT_EXCEPTION; |
102 | 102 | } |
103 | 103 | |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | { |
238 | 238 | $value = Arr::getValue($this->arguments, $arg); |
239 | 239 | if (!empty($value)) { |
240 | - $setter = 'set' . ucfirst($arg); |
|
240 | + $setter = 'set'.ucfirst($arg); |
|
241 | 241 | $configuration->{$setter}($value); |
242 | 242 | } |
243 | 243 | } |
@@ -252,21 +252,21 @@ discard block |
||
252 | 252 | // check if upgrade is necessary |
253 | 253 | $latestVersion = $this->getLatestVersion(); |
254 | 254 | if (!$this->isPharOutdated($latestVersion)) { |
255 | - echo 'You already have the latest version of phpbu installed.' . PHP_EOL; |
|
255 | + echo 'You already have the latest version of phpbu installed.'.PHP_EOL; |
|
256 | 256 | exit(self::EXIT_SUCCESS); |
257 | 257 | } |
258 | 258 | |
259 | 259 | $remoteFilename = 'http://phar.phpbu.de/phpbu.phar'; |
260 | 260 | $localFilename = realpath($_SERVER['argv'][0]); |
261 | - $tempFilename = basename($localFilename, '.phar') . '-temp.phar'; |
|
261 | + $tempFilename = basename($localFilename, '.phar').'-temp.phar'; |
|
262 | 262 | |
263 | - echo 'Updating the phpbu PHAR to version ' . $latestVersion . ' ... '; |
|
263 | + echo 'Updating the phpbu PHAR to version '.$latestVersion.' ... '; |
|
264 | 264 | |
265 | 265 | $old = error_reporting(0); |
266 | 266 | $phar = file_get_contents($remoteFilename); |
267 | 267 | error_reporting($old); |
268 | 268 | if (!$phar) { |
269 | - echo ' failed' . PHP_EOL . 'Could not reach phpbu update site' . PHP_EOL; |
|
269 | + echo ' failed'.PHP_EOL.'Could not reach phpbu update site'.PHP_EOL; |
|
270 | 270 | exit(self::EXIT_EXCEPTION); |
271 | 271 | } |
272 | 272 | file_put_contents($tempFilename, $phar); |
@@ -282,11 +282,11 @@ discard block |
||
282 | 282 | } catch (Exception $e) { |
283 | 283 | // cleanup crappy phar |
284 | 284 | unlink($tempFilename); |
285 | - echo 'failed' . PHP_EOL . $e->getMessage() . PHP_EOL; |
|
285 | + echo 'failed'.PHP_EOL.$e->getMessage().PHP_EOL; |
|
286 | 286 | exit(self::EXIT_EXCEPTION); |
287 | 287 | } |
288 | 288 | |
289 | - echo 'done' . PHP_EOL; |
|
289 | + echo 'done'.PHP_EOL; |
|
290 | 290 | exit(self::EXIT_SUCCESS); |
291 | 291 | } |
292 | 292 | |
@@ -299,10 +299,10 @@ discard block |
||
299 | 299 | |
300 | 300 | $latestVersion = $this->getLatestVersion(); |
301 | 301 | if ($this->isPharOutdated($latestVersion)) { |
302 | - print 'You are not using the latest version of phpbu.' . PHP_EOL |
|
303 | - . 'Use "phpbu --self-update" to install phpbu ' . $latestVersion . PHP_EOL; |
|
302 | + print 'You are not using the latest version of phpbu.'.PHP_EOL |
|
303 | + . 'Use "phpbu --self-update" to install phpbu '.$latestVersion.PHP_EOL; |
|
304 | 304 | } else { |
305 | - print 'You are using the latest version of phpbu.' . PHP_EOL; |
|
305 | + print 'You are using the latest version of phpbu.'.PHP_EOL; |
|
306 | 306 | } |
307 | 307 | exit(self::EXIT_SUCCESS); |
308 | 308 | } |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | $version = file_get_contents('https://phar.phpbu.de/latest-version-of/phpbu'); |
320 | 320 | error_reporting($old); |
321 | 321 | if (!$version) { |
322 | - echo 'Network-Error: Could not check latest version.' . PHP_EOL; |
|
322 | + echo 'Network-Error: Could not check latest version.'.PHP_EOL; |
|
323 | 323 | exit(self::EXIT_EXCEPTION); |
324 | 324 | } |
325 | 325 | return $version; |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | return; |
346 | 346 | } |
347 | 347 | |
348 | - echo Version::getVersionString() . PHP_EOL . PHP_EOL; |
|
348 | + echo Version::getVersionString().PHP_EOL.PHP_EOL; |
|
349 | 349 | $this->isVersionStringPrinted = true; |
350 | 350 | } |
351 | 351 | |
@@ -370,8 +370,8 @@ discard block |
||
370 | 370 | |
371 | 371 | EOT; |
372 | 372 | if ($this->isPhar) { |
373 | - echo ' --version-check Check whether phpbu is up to date.' . PHP_EOL; |
|
374 | - echo ' --self-update Upgrade phpbu to the latest version.' . PHP_EOL; |
|
373 | + echo ' --version-check Check whether phpbu is up to date.'.PHP_EOL; |
|
374 | + echo ' --self-update Upgrade phpbu to the latest version.'.PHP_EOL; |
|
375 | 375 | } |
376 | 376 | } |
377 | 377 | |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | { |
386 | 386 | $help = $hint ? ', use "phpbu -h" for help' : ''; |
387 | 387 | $this->printVersionString(); |
388 | - echo $message . $help . PHP_EOL; |
|
388 | + echo $message.$help.PHP_EOL; |
|
389 | 389 | exit(self::EXIT_EXCEPTION); |
390 | 390 | } |
391 | 391 |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | if ($this->deleteTarget) { |
86 | 86 | $this->deleteTarget = false; |
87 | 87 | $result->debug('target will be deleted as well'); |
88 | - $result->debug('delete ' . $target->getPathname()); |
|
88 | + $result->debug('delete '.$target->getPathname()); |
|
89 | 89 | } |
90 | 90 | parent::simulate($target, $collector, $result); |
91 | 91 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | // should the currently created backup be deleted as well? |
140 | 140 | if ($this->deleteTarget) { |
141 | 141 | $file = $target->toFile(); |
142 | - $index = date('YmdHis', $file->getMTime()) . '-' . count($files) . '-' . $file->getPathname(); |
|
142 | + $index = date('YmdHis', $file->getMTime()).'-'.count($files).'-'.$file->getPathname(); |
|
143 | 143 | $files[$index] = $file; |
144 | 144 | } |
145 | 145 | return $files; |
@@ -146,7 +146,7 @@ |
||
146 | 146 | $result->debug($tar->getCmdPrintable()); |
147 | 147 | |
148 | 148 | if (!$tar->isSuccessful()) { |
149 | - throw new Exception('tar failed: ' . $tar->getStdErr()); |
|
149 | + throw new Exception('tar failed: '.$tar->getStdErr()); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | return $this->createStatus($target); |
@@ -260,7 +260,7 @@ |
||
260 | 260 | |
261 | 261 | $tar->addOptionIfNotEmpty('--force-local', $this->local, false); |
262 | 262 | $tar->addOptionIfNotEmpty('--use-compress-program', $this->compressProgram); |
263 | - $tar->addOption('-' . (empty($this->compressProgram) ? $this->compression : '') . $create); |
|
263 | + $tar->addOption('-'.(empty($this->compressProgram) ? $this->compression : '').$create); |
|
264 | 264 | |
265 | 265 | if ($this->isThrottled()) { |
266 | 266 | $pv = new Cmd('pv'); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | 'mongodump' => [], |
44 | 44 | 'mysqldump' => [ |
45 | 45 | '/usr/local/mysql/bin', // Mac OS X |
46 | - '/usr/mysql/bin', // Linux |
|
46 | + '/usr/mysql/bin', // Linux |
|
47 | 47 | ], |
48 | 48 | 'tar' => [], |
49 | 49 | ]; |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | */ |
121 | 121 | public static function detectCmdLocationInPath(string $cmd, string $path) : string |
122 | 122 | { |
123 | - $command = $path . DIRECTORY_SEPARATOR . $cmd; |
|
123 | + $command = $path.DIRECTORY_SEPARATOR.$cmd; |
|
124 | 124 | $bin = self::isExecutable($command); |
125 | 125 | if (empty($bin)) { |
126 | 126 | throw new RuntimeException(sprintf('wrong path specified for \'%s\': %s', $cmd, $path)); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | public static function detectCmdLocationInPaths($cmd, array $paths) : string |
157 | 157 | { |
158 | 158 | foreach ($paths as $path) { |
159 | - $command = $path . DIRECTORY_SEPARATOR . $cmd; |
|
159 | + $command = $path.DIRECTORY_SEPARATOR.$cmd; |
|
160 | 160 | $bin = self::isExecutable($command); |
161 | 161 | if (!empty($bin)) { |
162 | 162 | return $bin; |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | return $path; |
263 | 263 | } |
264 | 264 | |
265 | - $file = $base . DIRECTORY_SEPARATOR . $path; |
|
265 | + $file = $base.DIRECTORY_SEPARATOR.$path; |
|
266 | 266 | |
267 | 267 | if ($useIncludePath && !file_exists($file)) { |
268 | 268 | $includePathFile = stream_resolve_include_path($path); |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | |
296 | 296 | $styledLines = []; |
297 | 297 | foreach ($lines as $line) { |
298 | - $styledLines[] = strlen($line) ? $style . str_pad($line, $padding) . "\x1b[0m" : ''; |
|
298 | + $styledLines[] = strlen($line) ? $style.str_pad($line, $padding)."\x1b[0m" : ''; |
|
299 | 299 | } |
300 | 300 | |
301 | 301 | return implode(PHP_EOL, $styledLines); |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | */ |
311 | 311 | public static function formatWithAsterisk(string $buffer, int $length = 75) : string |
312 | 312 | { |
313 | - return $buffer . str_repeat('*', $length - strlen($buffer)) . PHP_EOL; |
|
313 | + return $buffer.str_repeat('*', $length - strlen($buffer)).PHP_EOL; |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | /** |
@@ -334,10 +334,10 @@ discard block |
||
334 | 334 | if ('.' === $file || '..' === $file) { |
335 | 335 | continue; |
336 | 336 | } |
337 | - if (is_dir($dir . '/' . $file)) { |
|
338 | - self::removeDir($dir . '/' . $file); |
|
337 | + if (is_dir($dir.'/'.$file)) { |
|
338 | + self::removeDir($dir.'/'.$file); |
|
339 | 339 | } else { |
340 | - unlink($dir . '/' . $file); |
|
340 | + unlink($dir.'/'.$file); |
|
341 | 341 | } |
342 | 342 | } |
343 | 343 | rmdir($dir); |