@@ -45,11 +45,11 @@ |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | if ($this->option('limit')) { |
48 | - $synchronizer->limit = (int) $this->option('limit'); |
|
48 | + $synchronizer->limit = (int)$this->option('limit'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | $synchronizer->run(); |
52 | 52 | |
53 | - $this->info(PHP_EOL.'Synchronization done!'); |
|
53 | + $this->info(PHP_EOL . 'Synchronization done!'); |
|
54 | 54 | } |
55 | 55 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public function run(): void |
42 | 42 | { |
43 | 43 | foreach ($this->getTables() as $table) { |
44 | - $this->feedback(PHP_EOL.PHP_EOL . "Table: $table", 'line'); |
|
44 | + $this->feedback(PHP_EOL . PHP_EOL . "Table: $table", 'line'); |
|
45 | 45 | |
46 | 46 | $this->syncTable($table); |
47 | 47 | $this->syncRows($table); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | foreach ($rows as $row) { |
98 | 98 | $exists = $this->toDB->table($table)->where($queryColumn, $row->{$queryColumn})->first(); |
99 | 99 | |
100 | - if (! $exists) { |
|
100 | + if (!$exists) { |
|
101 | 101 | $this->toDB->table($table)->insert((array)$row); |
102 | 102 | } else { |
103 | 103 | $this->toDB->table($table)->where($queryColumn, $row->{$queryColumn})->update((array)$row); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | { |
127 | 127 | $this->feedback("Creating '$this->to.$table' table", 'warn'); |
128 | 128 | |
129 | - Schema::connection($this->to)->create($table, function (Blueprint $table_bp) use($table, $columns) { |
|
129 | + Schema::connection($this->to)->create($table, function(Blueprint $table_bp) use($table, $columns) { |
|
130 | 130 | foreach ($columns as $column) { |
131 | 131 | $type = Schema::connection($this->from)->getColumnType($table, $column); |
132 | 132 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | private function updateTable(string $table, string $column): void |
141 | 141 | { |
142 | - Schema::connection($this->to)->table($table, function (Blueprint $table_bp) use ($table, $column) { |
|
142 | + Schema::connection($this->to)->table($table, function(Blueprint $table_bp) use ($table, $column) { |
|
143 | 143 | $type = Schema::connection($this->from)->getColumnType($table, $column); |
144 | 144 | |
145 | 145 | $table_bp->{$type}($column)->nullable(); |