@@ -14,44 +14,44 @@ discard block |
||
14 | 14 | */ |
15 | 15 | public function processHandler() |
16 | 16 | { |
17 | - return $this->errorHandler(function(){ |
|
17 | + return $this->errorHandler(function() { |
|
18 | 18 | |
19 | 19 | $results = []; |
20 | 20 | |
21 | - foreach ($this->list as $table =>$datas){ |
|
21 | + foreach ($this->list as $table =>$datas) { |
|
22 | 22 | |
23 | - foreach ($datas as $data){ |
|
23 | + foreach ($datas as $data) { |
|
24 | 24 | |
25 | - $query = $this->queryBuilder($table,$data); |
|
25 | + $query = $this->queryBuilder($table, $data); |
|
26 | 26 | |
27 | 27 | $query = $query->handle(); |
28 | 28 | |
29 | - if($query===false){ |
|
29 | + if ($query===false) { |
|
30 | 30 | $results[] = []; |
31 | 31 | } |
32 | - else{ |
|
33 | - $status =($query['result']!==false) ? true : false; |
|
32 | + else { |
|
33 | + $status = ($query['result']!==false) ? true : false; |
|
34 | 34 | |
35 | - if($status){ |
|
35 | + if ($status) { |
|
36 | 36 | |
37 | - $this->schema->getConnection()->registerMigration($table,$data->getFile()); |
|
37 | + $this->schema->getConnection()->registerMigration($table, $data->getFile()); |
|
38 | 38 | |
39 | - if(app()->isLocale()){ |
|
39 | + if (app()->isLocale()) { |
|
40 | 40 | |
41 | 41 | $this->schema->getConnection()->generateEntity($table); |
42 | 42 | |
43 | - if(substr($table,-1)=='s'){ |
|
44 | - app()->command('model create','model:'.strtolower(substr($table,0,-1)).' table:'.$table.' entity:'.$table); |
|
43 | + if (substr($table, -1)=='s') { |
|
44 | + app()->command('model create', 'model:'.strtolower(substr($table, 0, -1)).' table:'.$table.' entity:'.$table); |
|
45 | 45 | } |
46 | - else{ |
|
47 | - app()->command('model create','model:'.strtolower($table).' table:'.$table.' entity:'.$table); |
|
46 | + else { |
|
47 | + app()->command('model create', 'model:'.strtolower($table).' table:'.$table.' entity:'.$table); |
|
48 | 48 | } |
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | } |
53 | 53 | |
54 | - $results[]= [ |
|
54 | + $results[] = [ |
|
55 | 55 | 'success'=>$status, |
56 | 56 | 'file'=>$data->getFile(), |
57 | 57 | 'table'=>$table, |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | { |
82 | 82 | $alterBinds = $object->getAlterBinds(); |
83 | 83 | |
84 | - if(!is_null($alterBinds) && count($alterBinds)>1){ |
|
84 | + if (!is_null($alterBinds) && count($alterBinds)>1) { |
|
85 | 85 | exception()->runtime('Only one command can be applied to alter groups'); |
86 | 86 | } |
87 | 87 | |
88 | - if(count($object->getError())){ |
|
88 | + if (count($object->getError())) { |
|
89 | 89 | exception()->runtime(''.$object->getFile().' -> '.$object->getError()[0].''); |
90 | 90 | } |
91 | 91 |
@@ -28,8 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | if($query===false){ |
30 | 30 | $results[] = []; |
31 | - } |
|
32 | - else{ |
|
31 | + } else{ |
|
33 | 32 | $status =($query['result']!==false) ? true : false; |
34 | 33 | |
35 | 34 | if($status){ |
@@ -42,8 +41,7 @@ discard block |
||
42 | 41 | |
43 | 42 | if(substr($table,-1)=='s'){ |
44 | 43 | app()->command('model create','model:'.strtolower(substr($table,0,-1)).' table:'.$table.' entity:'.$table); |
45 | - } |
|
46 | - else{ |
|
44 | + } else{ |
|
47 | 45 | app()->command('model create','model:'.strtolower($table).' table:'.$table.' entity:'.$table); |
48 | 46 | } |
49 | 47 | } |