Test Failed
Push — master ( 02d5fc...a9d814 )
by Evgenii
39:43
created
src/logic/processors/PostgresProcessor.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,8 +19,9 @@  discard block
 block discarded – undo
19 19
         $ionicePath = $this->module->binaries['ionice'];
20 20
         $command = "PGPASSWORD='{$this->password}' {$ionicePath} -c{$this->io} {$binaryPath} -h {$this->host} -p {$this->port} -U {$this->username} -Fc -Z1 {$this->database} -f {$this->backupFilePath}";
21 21
         exec($command, $return);
22
-        if (!empty($return))
23
-            throw new PostgresDumpException();
22
+        if (!empty($return)) {
23
+                    throw new PostgresDumpException();
24
+        }
24 25
     }
25 26
 
26 27
     public function restore(array $tableNames = []): void
@@ -28,8 +29,9 @@  discard block
 block discarded – undo
28 29
         $binaryPath = $this->module->binaries['pg_restore'];
29 30
         $command = "PGPASSWORD='{$this->password}' {$binaryPath} -c -Fc -j 4 -h {$this->host} -p {$this->port} -U {$this->username}  -d {$this->database} {$this->backupFilePath}";
30 31
         exec($command, $return);
31
-        if (!empty($return))
32
-            throw new PostgresDumpException();
32
+        if (!empty($return)) {
33
+                    throw new PostgresDumpException();
34
+        }
33 35
     }
34 36
 
35 37
     public function init()
Please login to merge, or discard this patch.
src/logic/processors/DbProcessor.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,13 +56,15 @@
 block discarded – undo
56 56
         $dsn = substr($dsn, strpos($dsn, ':') + 1);
57 57
         $dsnParts = explode(';', $dsn);
58 58
 
59
-        if (empty($dsnParts))
60
-            throw new DsnParseException();
59
+        if (empty($dsnParts)) {
60
+                    throw new DsnParseException();
61
+        }
61 62
 
62 63
         foreach ($dsnParts as $part) {
63 64
             $row = explode('=', $part);
64
-            if (isset($row[0]) && isset($row[1]))
65
-                $this->parsedDsn[$row[0]] = $row[1];
65
+            if (isset($row[0]) && isset($row[1])) {
66
+                            $this->parsedDsn[$row[0]] = $row[1];
67
+            }
66 68
         }
67 69
 
68 70
         $this->host = $this->parsedDsn['host'] ?: null;
Please login to merge, or discard this patch.
src/logic/processors/MysqlProcessor.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,8 +22,9 @@  discard block
 block discarded – undo
22 22
         $this->checkBinary($ionicePath);
23 23
         $command = "{$ionicePath} -c{$this->io} {$mysqldumpPath} -h {$this->host} -P {$this->port} -u {$this->username}  -p{$this->password}  {$this->database} | {$gzipPath} -9 -c > {$this->backupFilePath}";
24 24
         (exec($command));
25
-        if (!file_exists($this->backupFilePath) || filesize($this->backupFilePath) < 100)
26
-            throw new MysqlDumpException();
25
+        if (!file_exists($this->backupFilePath) || filesize($this->backupFilePath) < 100) {
26
+                    throw new MysqlDumpException();
27
+        }
27 28
     }
28 29
 
29 30
     public function restore(array $tableNames = []): void
@@ -34,7 +35,8 @@  discard block
 block discarded – undo
34 35
         $this->checkBinary($mysqlPath);
35 36
         $command = "{$zcatPath} {$this->backupFilePath} | {$mysqlPath} -h {$this->host} -P {$this->port} -u {$this->username} -p{$this->password} {$this->database}";
36 37
         exec($command, $return);
37
-        if (!empty($return))
38
-            throw new PostgresDumpException();
38
+        if (!empty($return)) {
39
+                    throw new PostgresDumpException();
40
+        }
39 41
     }
40 42
 }
Please login to merge, or discard this patch.