Completed
Push — develop ( a15ded...e3f88e )
by Erwin
04:22
created
src/Commands/Restore.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@
 block discarded – undo
116 116
         }
117 117
 
118 118
         // Get the files matching the database identifier
119
-        $filesFilter = array_filter($files, function ($item) {
119
+        $filesFilter = array_filter($files, function($item) {
120 120
             return strpos($item, $this->database->getRealDatabase()->getDatabaseIdentifier());
121 121
         });
122 122
 
Please login to merge, or discard this patch.
tests/BaseTestCase.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         try {
38 38
             $reflection = new ReflectionClass($object);
39 39
         } catch (ReflectionException $e) {
40
-            throw new ReflectionException("Failed setting Protected property. Exception thrown: " . $e->getMessage());
40
+            throw new ReflectionException("Failed setting Protected property. Exception thrown: ".$e->getMessage());
41 41
         }
42 42
 
43 43
         $reflection_property = $reflection->getProperty($property);
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         try {
56 56
             $reflection = new ReflectionClass($object);
57 57
         } catch (ReflectionException $e) {
58
-            throw new ReflectionException("Failed getting Protected property. Exception thrown: " . $e->getMessage());
58
+            throw new ReflectionException("Failed getting Protected property. Exception thrown: ".$e->getMessage());
59 59
         }
60 60
 
61 61
         $reflection_property = $reflection->getProperty($property);
Please login to merge, or discard this patch.
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/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.
src/Databases/Database.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 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
         $this->buildDatabaseClass();
Please login to merge, or discard this patch.