@@ -25,7 +25,7 @@ |
||
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 | /** |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | public function run(): void |
40 | 40 | { |
41 | 41 | foreach ($this->getTables() as $table) { |
42 | - $this->feedback(PHP_EOL.PHP_EOL."Table: $table", 'line'); |
|
42 | + $this->feedback(PHP_EOL . PHP_EOL . "Table: $table", 'line'); |
|
43 | 43 | |
44 | 44 | $this->syncTable($table); |
45 | 45 | $this->syncRows($table); |
@@ -95,10 +95,10 @@ discard block |
||
95 | 95 | foreach ($rows as $row) { |
96 | 96 | $exists = $this->toDB->table($table)->where($queryColumn, $row->{$queryColumn})->first(); |
97 | 97 | |
98 | - if (! $exists) { |
|
99 | - $this->toDB->table($table)->insert((array) $row); |
|
98 | + if (!$exists) { |
|
99 | + $this->toDB->table($table)->insert((array)$row); |
|
100 | 100 | } else { |
101 | - $this->toDB->table($table)->where($queryColumn, $row->{$queryColumn})->update((array) $row); |
|
101 | + $this->toDB->table($table)->where($queryColumn, $row->{$queryColumn})->update((array)$row); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | if (isset($bar)) { |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | public function getTables(): array |
115 | 115 | { |
116 | - if (! empty($this->tables)) { |
|
116 | + if (!empty($this->tables)) { |
|
117 | 117 | return $this->tables; |
118 | 118 | } |
119 | 119 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | { |
125 | 125 | $this->feedback("Creating '$this->to.$table' table", 'warn'); |
126 | 126 | |
127 | - Schema::connection($this->to)->create($table, function (Blueprint $table_bp) use ($table, $columns) { |
|
127 | + Schema::connection($this->to)->create($table, function(Blueprint $table_bp) use ($table, $columns) { |
|
128 | 128 | foreach ($columns as $column) { |
129 | 129 | $type = Schema::connection($this->from)->getColumnType($table, $column); |
130 | 130 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | |
138 | 138 | private function updateTable(string $table, string $column): void |
139 | 139 | { |
140 | - Schema::connection($this->to)->table($table, function (Blueprint $table_bp) use ($table, $column) { |
|
140 | + Schema::connection($this->to)->table($table, function(Blueprint $table_bp) use ($table, $column) { |
|
141 | 141 | $type = Schema::connection($this->from)->getColumnType($table, $column); |
142 | 142 | |
143 | 143 | $table_bp->{$type}($column)->nullable(); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | if ($this->cli) { |
152 | 152 | $this->cli->{$type}($msg); |
153 | 153 | } else { |
154 | - echo PHP_EOL.$msg.PHP_EOL; |
|
154 | + echo PHP_EOL . $msg . PHP_EOL; |
|
155 | 155 | } |
156 | 156 | } |
157 | 157 | } |