Completed
Push — master ( c2f7a5...f0fb03 )
by Maarten
08:38 queued 05:47
created
src/DatabaseSynchronizerServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
      */
26 26
     public function register()
27 27
     {
28
-        $this->mergeConfigFrom(__DIR__.'/../config/database-synchronizer.php', 'database-synchronizer');
28
+        $this->mergeConfigFrom(__DIR__ . '/../config/database-synchronizer.php', 'database-synchronizer');
29 29
     }
30 30
 
31 31
     /**
Please login to merge, or discard this patch.
src/DatabaseSynchronizer.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
     public function run(): void
59 59
     {
60 60
         foreach ($this->getTables() as $table) {
61
-            $this->feedback(PHP_EOL.PHP_EOL."Table: $table", 'line');
61
+            $this->feedback(PHP_EOL . PHP_EOL . "Table: $table", 'line');
62 62
 
63
-            if (! Schema::connection($this->from)->hasTable($table)) {
63
+            if (!Schema::connection($this->from)->hasTable($table)) {
64 64
                 $this->feedback("Table '$table' does not exist in $this->from", 'error');
65 65
 
66 66
                 continue;
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $builder = $this->fromDB->table($table);
114 114
         $statement = $pdo->prepare($builder->toSql());
115 115
 
116
-        if (! $statement instanceof  \PDOStatement) {
116
+        if (!$statement instanceof  \PDOStatement) {
117 117
             return;
118 118
         }
119 119
 
@@ -136,10 +136,10 @@  discard block
 block discarded – undo
136 136
         while ($row = $statement->fetch(\PDO::FETCH_OBJ)) {
137 137
             $exists = $this->getToDb()->table($table)->where($queryColumn, $row->{$queryColumn})->first();
138 138
 
139
-            if (! $exists) {
140
-                $this->getToDb()->table($table)->insert((array) $row);
139
+            if (!$exists) {
140
+                $this->getToDb()->table($table)->insert((array)$row);
141 141
             } else {
142
-                $this->getToDb()->table($table)->where($queryColumn, $row->{$queryColumn})->update((array) $row);
142
+                $this->getToDb()->table($table)->where($queryColumn, $row->{$queryColumn})->update((array)$row);
143 143
             }
144 144
 
145 145
             if (isset($bar)) {
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
     {
162 162
         $this->feedback("Creating '$this->to.$table' table", 'warn');
163 163
 
164
-        Schema::connection($this->to)->create($table, function (Blueprint $table_bp) use ($table, $columns) {
164
+        Schema::connection($this->to)->create($table, function(Blueprint $table_bp) use ($table, $columns) {
165 165
             foreach ($columns as $column) {
166 166
                 $type = Schema::connection($this->from)->getColumnType($table, $column);
167 167
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 
175 175
     private function updateTable(string $table, string $column): void
176 176
     {
177
-        Schema::connection($this->to)->table($table, function (Blueprint $table_bp) use ($table, $column) {
177
+        Schema::connection($this->to)->table($table, function(Blueprint $table_bp) use ($table, $column) {
178 178
             $type = Schema::connection($this->from)->getColumnType($table, $column);
179 179
 
180 180
             $table_bp->{$type}($column)->nullable();
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         if ($this->cli) {
189 189
             $this->cli->{$type}($msg);
190 190
         } else {
191
-            echo PHP_EOL.$msg.PHP_EOL;
191
+            echo PHP_EOL . $msg . PHP_EOL;
192 192
         }
193 193
     }
194 194
 }
Please login to merge, or discard this patch.
src/Commands/Synchronise.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,14 +54,14 @@
 block discarded – undo
54 54
         }
55 55
 
56 56
         if ($this->option('limit')) {
57
-            $synchronizer->limit = (int) $this->option('limit');
57
+            $synchronizer->limit = (int)$this->option('limit');
58 58
         }
59 59
 
60 60
         $synchronizer->truncate = $this->option('truncate');
61 61
 
62 62
         $synchronizer->run();
63 63
 
64
-        $this->info(PHP_EOL.'Synchronization done!');
64
+        $this->info(PHP_EOL . 'Synchronization done!');
65 65
     }
66 66
 
67 67
     private function getTables()
Please login to merge, or discard this patch.