Passed
Push — master ( c64f36...f7b7ba )
by Maarten
04:15 queued 14s
created
src/DatabaseSynchronizer.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     public function run(): void
58 58
     {
59 59
         foreach ($this->getTables() as $table) {
60
-            $this->feedback(PHP_EOL.PHP_EOL."Table: $table", 'line');
60
+            $this->feedback(PHP_EOL . PHP_EOL . "Table: $table", 'line');
61 61
 
62 62
             $this->syncTable($table);
63 63
             $this->syncRows($table);
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         $builder = $this->fromDB->table($table);
107 107
         $statement = $pdo->prepare($builder->toSql());
108 108
 
109
-        if (! $statement instanceof  \PDOStatement) {
109
+        if (!$statement instanceof  \PDOStatement) {
110 110
             return;
111 111
         }
112 112
 
@@ -125,10 +125,10 @@  discard block
 block discarded – undo
125 125
         while ($row = $statement->fetch(\PDO::FETCH_OBJ)) {
126 126
             $exists = $this->getToDb()->table($table)->where($queryColumn, $row->{$queryColumn})->first();
127 127
 
128
-            if (! $exists) {
129
-                $this->getToDb()->table($table)->insert((array) $row);
128
+            if (!$exists) {
129
+                $this->getToDb()->table($table)->insert((array)$row);
130 130
             } else {
131
-                $this->getToDb()->table($table)->where($queryColumn, $row->{$queryColumn})->update((array) $row);
131
+                $this->getToDb()->table($table)->where($queryColumn, $row->{$queryColumn})->update((array)$row);
132 132
             }
133 133
 
134 134
             if (isset($bar)) {
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 
144 144
     public function getTables(): array
145 145
     {
146
-        if (! empty($this->tables)) {
146
+        if (!empty($this->tables)) {
147 147
             return $this->tables;
148 148
         }
149 149
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
     {
155 155
         $this->feedback("Creating '$this->to.$table' table", 'warn');
156 156
 
157
-        Schema::connection($this->to)->create($table, function (Blueprint $table_bp) use ($table, $columns) {
157
+        Schema::connection($this->to)->create($table, function(Blueprint $table_bp) use ($table, $columns) {
158 158
             foreach ($columns as $column) {
159 159
                 $type = Schema::connection($this->from)->getColumnType($table, $column);
160 160
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 
168 168
     private function updateTable(string $table, string $column): void
169 169
     {
170
-        Schema::connection($this->to)->table($table, function (Blueprint $table_bp) use ($table, $column) {
170
+        Schema::connection($this->to)->table($table, function(Blueprint $table_bp) use ($table, $column) {
171 171
             $type = Schema::connection($this->from)->getColumnType($table, $column);
172 172
 
173 173
             $table_bp->{$type}($column)->nullable();
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
         if ($this->cli) {
182 182
             $this->cli->{$type}($msg);
183 183
         } else {
184
-            echo PHP_EOL.$msg.PHP_EOL;
184
+            echo PHP_EOL . $msg . PHP_EOL;
185 185
         }
186 186
     }
187 187
 }
Please login to merge, or discard this patch.