@@ -29,7 +29,7 @@ |
||
| 29 | 29 | public function sync(Target $target, Result $result) |
| 30 | 30 | { |
| 31 | 31 | $sourcePath = $target->getPathname(); |
| 32 | - $targetPath = $this->path . '/' . $target->getFilename(); |
|
| 32 | + $targetPath = $this->path . '/' . $target->getFilename(); |
|
| 33 | 33 | |
| 34 | 34 | $s3 = S3Client::factory( |
| 35 | 35 | [ |
@@ -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 | ]; |
@@ -82,20 +82,20 @@ discard block |
||
| 82 | 82 | public static function detectCmdLocation(string $cmd, string $path = '', array $optionalLocations = []) : string |
| 83 | 83 | { |
| 84 | 84 | $detectionSteps = [ |
| 85 | - function ($cmd) use ($path) { |
|
| 85 | + function($cmd) use ($path) { |
|
| 86 | 86 | if (!empty($path)) { |
| 87 | 87 | return self::detectCmdLocationInPath($cmd, $path); |
| 88 | 88 | } |
| 89 | 89 | return ''; |
| 90 | 90 | }, |
| 91 | - function ($cmd) { |
|
| 91 | + function($cmd) { |
|
| 92 | 92 | return self::detectCmdLocationWithWhich($cmd); |
| 93 | 93 | }, |
| 94 | - function ($cmd) { |
|
| 94 | + function($cmd) { |
|
| 95 | 95 | $paths = explode(PATH_SEPARATOR, self::getEnvPath()); |
| 96 | 96 | return self::detectCmdLocationInPaths($cmd, $paths); |
| 97 | 97 | }, |
| 98 | - function ($cmd) use ($optionalLocations) { |
|
| 98 | + function($cmd) use ($optionalLocations) { |
|
| 99 | 99 | return self::detectCmdLocationInPaths($cmd, $optionalLocations); |
| 100 | 100 | } |
| 101 | 101 | ]; |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | $time = $time === null ? time() : $time; |
| 28 | 28 | return preg_replace_callback( |
| 29 | 29 | '#%([a-zA-Z])#', |
| 30 | - function ($match) use ($time) { |
|
| 30 | + function($match) use ($time) { |
|
| 31 | 31 | return date($match[1], $time); |
| 32 | 32 | }, |
| 33 | 33 | $string |
@@ -224,7 +224,7 @@ |
||
| 224 | 224 | $cmd->addOptionIfNotEmpty('-C', $this->compress, false); |
| 225 | 225 | |
| 226 | 226 | if (!empty($this->sourceFilename)) { |
| 227 | - $cmd->addOption('--execute', 'source '.$this->sourceFilename); |
|
| 227 | + $cmd->addOption('--execute', 'source ' . $this->sourceFilename); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | return $process; |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | ksort($files); |
| 66 | 66 | |
| 67 | 67 | while ($this->isCapacityExceeded($files)) { |
| 68 | - $file = array_shift($files); |
|
| 68 | + $file = array_shift($files); |
|
| 69 | 69 | if ($file === null) { |
| 70 | 70 | break; |
| 71 | 71 | } |
@@ -201,7 +201,7 @@ |
||
| 201 | 201 | . $info |
| 202 | 202 | . $footer |
| 203 | 203 | . '</body></html>'; |
| 204 | - $state = $result->allOk() ? 'OK' : ($result->backupOkButSkipsOrFails() ? 'WARNING' : 'ERROR'); |
|
| 204 | + $state = $result->allOk() ? 'OK' : ($result->backupOkButSkipsOrFails() ? 'WARNING' : 'ERROR'); |
|
| 205 | 205 | |
| 206 | 206 | $this->mailer->Subject = $this->subject . ' [' . ($this->isSimulation ? 'SIMULATION' : $state) . ']'; |
| 207 | 207 | $this->mailer->setFrom($this->senderMail, $this->senderName); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $this->write('# HELP phpbu_backup_success Whether or not the backup succeeded' . PHP_EOL); |
| 88 | 88 | $this->write('# TYPE phpbu_backup_success gauge' . PHP_EOL); |
| 89 | 89 | foreach ($event->getResult()->getBackups() as $backupResult) { |
| 90 | - $this->write('phpbu_backup_success{name="' . $backupResult->getName() . '"} ' . (int)$backupResult->allOk() . PHP_EOL); |
|
| 90 | + $this->write('phpbu_backup_success{name="' . $backupResult->getName() . '"} ' . (int) $backupResult->allOk() . PHP_EOL); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | $this->write(PHP_EOL); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $this->write('# HELP phpbu_backup_last_run The unix timestamp of the last run' . PHP_EOL); |
| 105 | 105 | $this->write('# TYPE phpbu_backup_last_run counter' . PHP_EOL); |
| 106 | 106 | foreach ($this->backupStats as $backupName => $backupStats) { |
| 107 | - $this->write('phpbu_backup_last_run{name="' . $backupName . '"} ' . (int)$this->backupStats[$backupName]['lastRun'] . PHP_EOL); |
|
| 107 | + $this->write('phpbu_backup_last_run{name="' . $backupName . '"} ' . (int) $this->backupStats[$backupName]['lastRun'] . PHP_EOL); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | $this->write(PHP_EOL); |
@@ -49,8 +49,8 @@ |
||
| 49 | 49 | */ |
| 50 | 50 | public function __construct(Runner $runner = null, $time = null) |
| 51 | 51 | { |
| 52 | - $this->runner = $runner ? : new Runner\Simple(); |
|
| 53 | - $this->time = $time ? : time(); |
|
| 52 | + $this->runner = $runner ?: new Runner\Simple(); |
|
| 53 | + $this->time = $time ?: time(); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $this->file = AppUtil\Path::toAbsolutePath($path, Configuration::getWorkingDirectory()); |
| 46 | 46 | |
| 47 | 47 | // dotenv version 4 and higher |
| 48 | - if (method_exists('Dotenv\\Dotenv','createImmutable')) { |
|
| 48 | + if (method_exists('Dotenv\\Dotenv', 'createImmutable')) { |
|
| 49 | 49 | $this->dotenv = DotenvLib::createImmutable(dirname($this->file), basename($this->file)); |
| 50 | 50 | } else { |
| 51 | 51 | $this->dotenv = DotenvLib::create(dirname($this->file), basename($this->file)); |