@@ -80,7 +80,7 @@ |
||
80 | 80 | foreach ($JsonExtractor->getTablesArray() as $TableName => $TableColumn) { |
81 | 81 | |
82 | 82 | $this->capsule::schema()->dropIfExists($TableName); |
83 | - $this->capsule::schema()->create($TableName, function ($table) use ($TableColumn) { |
|
83 | + $this->capsule::schema()->create($TableName, function($table) use ($TableColumn) { |
|
84 | 84 | |
85 | 85 | |
86 | 86 | foreach ($TableColumn as $column_item) { |
@@ -64,15 +64,15 @@ discard block |
||
64 | 64 | |
65 | 65 | if (is_array($value) && is_object($value[0])) {//check whether it's a array and it's firs element is a object |
66 | 66 | |
67 | - $table_data = $this->getTable($prefix . $table_name, $value);//get table sql |
|
67 | + $table_data = $this->getTable($prefix.$table_name, $value); //get table sql |
|
68 | 68 | $this->table[$table_data['tables']['name']] = $table_data['tables']['column']; |
69 | 69 | $this->data[$table_data['data']['table']] = $table_data['data']['data']; |
70 | 70 | |
71 | - $this->toMysqlTables($this->getHighestColumnArray($value), $prefix . $table_name . '_');//get it inside tables |
|
71 | + $this->toMysqlTables($this->getHighestColumnArray($value), $prefix.$table_name.'_'); //get it inside tables |
|
72 | 72 | |
73 | 73 | } elseif (is_array($value) || is_object($value)) {//if it's a array and firs element is not a object |
74 | 74 | |
75 | - $table_data = $this->getTable($prefix . $table_name, $value); |
|
75 | + $table_data = $this->getTable($prefix.$table_name, $value); |
|
76 | 76 | $this->table[$table_data['tables']['name']] = $table_data['tables']['column']; |
77 | 77 | $this->data[$table_data['data']['table']] = $table_data['data']['data']; |
78 | 78 | } |
@@ -240,12 +240,12 @@ discard block |
||
240 | 240 | } elseif (is_numeric($item)) |
241 | 241 | $value[] = $item; |
242 | 242 | else |
243 | - $value[] = '"' . addcslashes($item, "W") . '"'; |
|
243 | + $value[] = '"'.addcslashes($item, "W").'"'; |
|
244 | 244 | } |
245 | - $String[] = '(' . implode(",", $value) . ')'; |
|
245 | + $String[] = '('.implode(",", $value).')'; |
|
246 | 246 | } |
247 | 247 | |
248 | - return "values" . implode(", ", $String); |
|
248 | + return "values".implode(", ", $String); |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | /** |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | { |
257 | 257 | $String = []; |
258 | 258 | foreach ($array as $column) { |
259 | - $String[] = "`" . JsonExtractor::snakeCase($column['name']) . "`"; |
|
259 | + $String[] = "`".JsonExtractor::snakeCase($column['name'])."`"; |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | return implode(",", $String); |
@@ -275,6 +275,6 @@ discard block |
||
275 | 275 | } elseif (empty($Data)) |
276 | 276 | return $empty_val; |
277 | 277 | else |
278 | - return (string)$Data; |
|
278 | + return (string) $Data; |
|
279 | 279 | } |
280 | 280 | } |
@@ -45,8 +45,8 @@ |
||
45 | 45 | */ |
46 | 46 | function validate($json) |
47 | 47 | { |
48 | - if(is_array($json)){ |
|
49 | - return (object)[ |
|
48 | + if (is_array($json)) { |
|
49 | + return (object) [ |
|
50 | 50 | $this->main_table_name=>$json |
51 | 51 | ]; |
52 | 52 | } |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?PHP |
2 | 2 | |
3 | -function sd(){ |
|
3 | +function sd() { |
|
4 | 4 | $Args = func_get_args(); |
5 | 5 | $console = new \PhpConsoleColor\Console(); |
6 | 6 | |
7 | - foreach($Args as $str) { |
|
7 | + foreach ($Args as $str) { |
|
8 | 8 | $str = print_r($str, TRUE); |
9 | 9 | $console->writeLn("<green>$str</green>"); |
10 | 10 | |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | |
20 | -function s(){ |
|
20 | +function s() { |
|
21 | 21 | $Args = func_get_args(); |
22 | 22 | $console = new \PhpConsoleColor\Console(); |
23 | 23 | |
24 | - foreach($Args as $str) { |
|
24 | + foreach ($Args as $str) { |
|
25 | 25 | $str = print_r($str, TRUE); |
26 | 26 | $console->writeLn("<green>$str</green>"); |
27 | 27 | } |