@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | /** |
16 | 16 | * @var $type |
17 | 17 | */ |
18 | - public $type='migration'; |
|
18 | + public $type = 'migration'; |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * @var array |
@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | /** |
34 | 34 | * @var $commandRule |
35 | 35 | */ |
36 | - public $commandRule=['create'=>[ |
|
37 | - 'name','table' |
|
36 | + public $commandRule = ['create'=>[ |
|
37 | + 'name', 'table' |
|
38 | 38 | ], |
39 | 39 | 'push'=>[]]; |
40 | 40 | |
@@ -63,14 +63,14 @@ discard block |
||
63 | 63 | |
64 | 64 | foreach ($pushResult as $key=>$value) { |
65 | 65 | |
66 | - if(isset($value['success'])){ |
|
66 | + if (isset($value['success'])) { |
|
67 | 67 | |
68 | 68 | $list[] = true; |
69 | 69 | |
70 | - $pushResultFile = explode("/",$pushResult[$key]['file']); |
|
70 | + $pushResultFile = explode("/", $pushResult[$key]['file']); |
|
71 | 71 | $file = end($pushResultFile); |
72 | 72 | |
73 | - if($pushResult[$key]['success']===true){ |
|
73 | + if ($pushResult[$key]['success']===true) { |
|
74 | 74 | |
75 | 75 | $this->table->addRow([ |
76 | 76 | $key, |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | 'No', |
83 | 83 | ]); |
84 | 84 | } |
85 | - else{ |
|
85 | + else { |
|
86 | 86 | |
87 | 87 | $this->table->addRow([ |
88 | 88 | $key, |
@@ -98,12 +98,12 @@ discard block |
||
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
101 | - if(count($list)){ |
|
102 | - $this->table->setHeaders(['id','table','file','type','status','message','seeder']); |
|
101 | + if (count($list)) { |
|
102 | + $this->table->setHeaders(['id', 'table', 'file', 'type', 'status', 'message', 'seeder']); |
|
103 | 103 | |
104 | 104 | echo $this->table->getTable(); |
105 | 105 | } |
106 | - else{ |
|
106 | + else { |
|
107 | 107 | echo $this->classical('No migration was found to apply'); |
108 | 108 | } |
109 | 109 | |
@@ -117,10 +117,10 @@ discard block |
||
117 | 117 | { |
118 | 118 | $config = $this->getConfig(); |
119 | 119 | |
120 | - if(!isset($this->argument['group'])){ |
|
120 | + if (!isset($this->argument['group'])) { |
|
121 | 121 | $path = $config['paths'][0]; |
122 | 122 | } |
123 | - else{ |
|
123 | + else { |
|
124 | 124 | $path = $config['paths'][strtolower($this->argument['group'])]; |
125 | 125 | } |
126 | 126 | |
@@ -130,19 +130,19 @@ discard block |
||
130 | 130 | |
131 | 131 | $stubType = (!file_exists($tablePath)) ? 'create' : 'alter'; |
132 | 132 | |
133 | - if(!file_exists($path)){ |
|
133 | + if (!file_exists($path)) { |
|
134 | 134 | |
135 | - $this->file->fs->mkdir($path,0777); |
|
136 | - $this->file->fs->chmod($path,0777,000,true); |
|
135 | + $this->file->fs->mkdir($path, 0777); |
|
136 | + $this->file->fs->chmod($path, 0777, 000, true); |
|
137 | 137 | } |
138 | 138 | |
139 | - $migrationCreate = $this->getSchema()->stub($this->argument,$stubType); |
|
139 | + $migrationCreate = $this->getSchema()->stub($this->argument, $stubType); |
|
140 | 140 | |
141 | 141 | echo $this->info('Migration Create Process :'); |
142 | 142 | |
143 | - $this->table->setHeaders(['id','method','table','style','name','type','status','message']); |
|
143 | + $this->table->setHeaders(['id', 'method', 'table', 'style', 'name', 'type', 'status', 'message']); |
|
144 | 144 | |
145 | - foreach ($migrationCreate['directory'] as $key=>$data){ |
|
145 | + foreach ($migrationCreate['directory'] as $key=>$data) { |
|
146 | 146 | |
147 | 147 | $this->table->addRow([ |
148 | 148 | $key, |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | ]); |
158 | 158 | } |
159 | 159 | |
160 | - foreach ($migrationCreate['file'] as $key=>$data){ |
|
160 | + foreach ($migrationCreate['file'] as $key=>$data) { |
|
161 | 161 | |
162 | 162 | $this->table->addRow([ |
163 | 163 | $key, |
@@ -188,13 +188,13 @@ discard block |
||
188 | 188 | 'arguments' => $this->argument |
189 | 189 | ]; |
190 | 190 | |
191 | - $paths['paths'] = array_merge($paths['paths'],[StaticPathModel::storeMigrationPath()]); |
|
191 | + $paths['paths'] = array_merge($paths['paths'], [StaticPathModel::storeMigrationPath()]); |
|
192 | 192 | |
193 | 193 | foreach (config('database.migrations') as $key=>$item) { |
194 | - if($key!=='default'){ |
|
194 | + if ($key!=='default') { |
|
195 | 195 | |
196 | 196 | $otherMigrationPath = path()->migration().''.$item; |
197 | - $paths['paths'] = array_merge($paths['paths'],[$key=>$otherMigrationPath]); |
|
197 | + $paths['paths'] = array_merge($paths['paths'], [$key=>$otherMigrationPath]); |
|
198 | 198 | } |
199 | 199 | } |
200 | 200 |
@@ -81,8 +81,7 @@ discard block |
||
81 | 81 | 'Ok', |
82 | 82 | 'No', |
83 | 83 | ]); |
84 | - } |
|
85 | - else{ |
|
84 | + } else{ |
|
86 | 85 | |
87 | 86 | $this->table->addRow([ |
88 | 87 | $key, |
@@ -102,8 +101,7 @@ discard block |
||
102 | 101 | $this->table->setHeaders(['id','table','file','type','status','message','seeder']); |
103 | 102 | |
104 | 103 | echo $this->table->getTable(); |
105 | - } |
|
106 | - else{ |
|
104 | + } else{ |
|
107 | 105 | echo $this->classical('No migration was found to apply'); |
108 | 106 | } |
109 | 107 | |
@@ -119,8 +117,7 @@ discard block |
||
119 | 117 | |
120 | 118 | if(!isset($this->argument['group'])){ |
121 | 119 | $path = $config['paths'][0]; |
122 | - } |
|
123 | - else{ |
|
120 | + } else{ |
|
124 | 121 | $path = $config['paths'][strtolower($this->argument['group'])]; |
125 | 122 | } |
126 | 123 |