Completed
Push — develop ( a17f3a...27927e )
by Erwin
05:57
created
src/Databases/MySQLDatabase.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         $this->fileExtension = 'sql';
42 42
         $this->databaseIdentifier = 'mysql';
43 43
 
44
-        $this->processHandler=$processHandler;
44
+        $this->processHandler = $processHandler;
45 45
     }
46 46
 
47 47
     /**
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         Log::debug('Starting MySQL import procedure.');
99 99
 
100 100
         $startTimeImport = microtime(true);
101
-        $backupFile = '"' . addcslashes($backupFile, '\\"') . '"';
101
+        $backupFile = '"'.addcslashes($backupFile, '\\"').'"';
102 102
         $command = sprintf('mysql %s %s < %s', $this->getCredentials(), $this->database, $backupFile);
103 103
 
104 104
         if (false === $this->processHandler->run($command)) {
Please login to merge, or discard this patch.
src/Databases/Database.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     public function __construct()
36 36
     {
37 37
         $this->database = Config::get('database.default');
38
-        $this->realDatabase = Config::get('database.connections.' . $this->database);
38
+        $this->realDatabase = Config::get('database.connections.'.$this->database);
39 39
         $this->processHandler = new ProcessHandler();
40 40
 
41 41
         // Check if the current database driver is supported
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      */
85 85
     public function generateBackupFilename(string $databaseIdentifier, string $databaseFileExtension): string
86 86
     {
87
-        return $this->backupFilename = $this->storageFolder . $databaseIdentifier . '-' . time() . '.' . $databaseFileExtension;
87
+        return $this->backupFilename = $this->storageFolder.$databaseIdentifier.'-'.time().'.'.$databaseFileExtension;
88 88
     }
89 89
 
90 90
     /**
Please login to merge, or discard this patch.
src/Databases/Storage.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         $configStoragePath = Config::get('db-backup.backup_folder');
30 30
         if (substr($configStoragePath, -1, 1) !== DIRECTORY_SEPARATOR) {
31 31
             Log::debug('Stored back-up folder is not probably set. Fixing.');
32
-            $configStoragePath = $configStoragePath . DIRECTORY_SEPARATOR;
32
+            $configStoragePath = $configStoragePath.DIRECTORY_SEPARATOR;
33 33
         }
34 34
 
35 35
         return $configStoragePath;
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      */
65 65
     public function generateBackupFilename(string $databaseIdentifier, string $databaseFileExtension): string
66 66
     {
67
-        return $this->backupFilename = $this->storagePath . $databaseIdentifier . '-' . time() . '.' . $databaseFileExtension;
67
+        return $this->backupFilename = $this->storagePath.$databaseIdentifier.'-'.time().'.'.$databaseFileExtension;
68 68
     }
69 69
 
70 70
     /**
@@ -83,12 +83,12 @@  discard block
 block discarded – undo
83 83
         }
84 84
 
85 85
         $process = new Process(['gzip', '-d', $workableFile]);
86
-        $process->run(function ($type, $buffer): bool {
86
+        $process->run(function($type, $buffer): bool {
87 87
             if (Process::OUT === $type) {
88
-                Log::debug('gzip buffer: ' . $buffer);
88
+                Log::debug('gzip buffer: '.$buffer);
89 89
             }
90 90
             if (Process::ERR === $type) {
91
-                Log::error('Error whilst performing zip action. Output of buffer: ' . $buffer);
91
+                Log::error('Error whilst performing zip action. Output of buffer: '.$buffer);
92 92
 
93 93
                 return false;
94 94
             }
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
     protected function createTmpFile(string $backupFile, Database $database): ?string
110 110
     {
111 111
         Log::debug('Creating temp back-up file to not corrupt the archives.');
112
-        $tmpFilename = 'tmp.' . microtime(true) . '.' . $database->getRealDatabase()->getFileExtension() . '.gz';
113
-        $filePath = $this->storagePath . $tmpFilename;
112
+        $tmpFilename = 'tmp.'.microtime(true).'.'.$database->getRealDatabase()->getFileExtension().'.gz';
113
+        $filePath = $this->storagePath.$tmpFilename;
114 114
 
115 115
         try {
116 116
             File::copy($backupFile, $filePath);
117 117
         } catch (Exception $e) {
118
-            Log::error('Could not create temporary archive file. Exception throw: ' . $e->getMessage());
118
+            Log::error('Could not create temporary archive file. Exception throw: '.$e->getMessage());
119 119
 
120 120
             return null;
121 121
         }
Please login to merge, or discard this patch.