Passed
Pull Request — master (#14)
by Maarten
03:47
created
src/Commands/Synchronise.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,11 +45,11 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
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   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.