Passed
Push — master ( 38a665...decd12 )
by Ferry
05:33
created
src/controllers/DeveloperModulesController.php 1 patch
Braces   +11 added lines, -9 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
             if(Str::contains(strtolower($item),["title","name","label"])) {
56 56
                 $display = true;
57
-            }else{
57
+            } else{
58 58
                 $display = false;
59 59
             }
60 60
 
@@ -83,7 +83,9 @@  discard block
 block discarded – undo
83 83
             if($column != $pk) {
84 84
 
85 85
                 // Skip Column
86
-                if($column == 'deleted_at') continue;
86
+                if($column == 'deleted_at') {
87
+                    continue;
88
+                }
87 89
 
88 90
                 // Check if any relation table candidate
89 91
                 $optionTable = "";
@@ -92,7 +94,7 @@  discard block
 block discarded – undo
92 94
                     if(Schema::hasTable($relationTable)) {
93 95
                         $optionTable = $relationTable;
94 96
                     }
95
-                }elseif (Str::substr(strtolower($column),0,3) == "id_") {
97
+                } elseif (Str::substr(strtolower($column),0,3) == "id_") {
96 98
                     $relationTable = Str::substr($column,3);
97 99
                     if(Schema::hasTable($relationTable)) {
98 100
                         $optionTable = $relationTable;
@@ -105,15 +107,15 @@  discard block
 block discarded – undo
105 107
 
106 108
                 if(Str::contains(strtolower($label),["photo","image","picture","gambar"])) {
107 109
                     $type = "image";
108
-                }elseif (Str::contains(strtolower($label),["email","mail"])) {
110
+                } elseif (Str::contains(strtolower($label),["email","mail"])) {
109 111
                     $type = "email";
110
-                }elseif (Str::contains(strtolower($label),["description","content","detail"])) {
112
+                } elseif (Str::contains(strtolower($label),["description","content","detail"])) {
111 113
                     $type =  "wysiwyg";
112
-                }elseif (Str::contains(strtolower($label),["price","money","grand_total","tax"])) {
114
+                } elseif (Str::contains(strtolower($label),["price","money","grand_total","tax"])) {
113 115
                     $type = "money";
114
-                }elseif (Str::contains(strtolower($label),["quantity","qty","total","phone","telp"])) {
116
+                } elseif (Str::contains(strtolower($label),["quantity","qty","total","phone","telp"])) {
115 117
                     $type = "number";
116
-                }elseif (Str::contains(strtolower($label),["date"])) {
118
+                } elseif (Str::contains(strtolower($label),["date"])) {
117 119
                     $type = "date";
118 120
                 }
119 121
 
@@ -219,7 +221,7 @@  discard block
 block discarded – undo
219 221
 
220 222
                     if($item['length']) {
221 223
                         $structureItems .= "\$table->".$item['type_data']."('".$item['field_name']."', ".$item['length'].")$nullable;\n\t\t\t";
222
-                    }else{
224
+                    } else{
223 225
                         $structureItems .= "\$table->".$item['type_data']."('".$item['field_name']."')$nullable;\n\t\t\t";
224 226
                     }
225 227
                 }
Please login to merge, or discard this patch.
src/helpers/ModuleGenerator.php 1 patch
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -112,15 +112,15 @@  discard block
 block discarded – undo
112 112
                         }
113 113
                         $scaffold .= '$this->add' . $methodName . '("' . $label . '","' . $column . '")->options('.min_var_export($optResult).')' . $additional . ';' . "\n\t\t";
114 114
                     }
115
-                }elseif (in_array($field['column_type'],['radio_table','select_table'])) {
115
+                } elseif (in_array($field['column_type'],['radio_table','select_table'])) {
116 116
                     if ($optionTable && $optionValue && $optionDisplay) {
117 117
                         $scaffold .= '$this->add' . $methodName . '("' . $label . '","' . $column . '",["table"=>"' . $optionTable . '","value_option"=>"' . $optionValue . '","display_option"=>"' . $optionDisplay . '","sql_condition"=>"' . $optionSqlCondition . '"])' . $additional . ';' . "\n\t\t";
118 118
                     }
119
-                }elseif ($field['column_type'] == "select_query") {
119
+                } elseif ($field['column_type'] == "select_query") {
120 120
                     if($sqlRawQuery && Str::contains($sqlRawQuery,["as `key`","as `label`"])) {
121 121
                         $scaffold .= '$this->add' . $methodName . '("' . $label . '","' . $column . '","'.$sqlRawQuery.'")' . $additional . ';' . "\n\t\t";
122 122
                     }
123
-                }else{
123
+                } else{
124 124
                     $scaffold .= '$this->add'.$methodName.'("'.$label.'","'.$column.'")'.$additional.';'."\n\t\t";
125 125
                 }
126 126
             }
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         if($moduleData = DB::table("cb_modules")->where("name", $name)->where("table_name",$this->table)->first()) {
147 147
             DB::table("cb_modules")->where("id",$moduleData->id)->update($module);
148 148
             $id_modules = $moduleData->id;
149
-        }else{
149
+        } else{
150 150
             $id_modules = DB::table('cb_modules')->insertGetId($module);
151 151
         }
152 152
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         $menu['cb_modules_id'] = $id_modules;
158 158
         if(isset($moduleData)) {
159 159
             DB::table("cb_menus")->where("cb_modules_id",$moduleData->id)->update($menu);
160
-        }else{
160
+        } else{
161 161
             DB::table('cb_menus')->insertGetId($menu);
162 162
         }
163 163
 
Please login to merge, or discard this patch.
src/helpers/CB.php 1 patch
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -92,14 +92,14 @@  discard block
 block discarded – undo
92 92
             if($resize_width || $resize_height) {
93 93
                 $this->resizeImage($file, $file_path.'/'.$filename, $resize_width, $resize_height);
94 94
                 return $file_path.'/'.$filename;
95
-            }else{
95
+            } else{
96 96
                 if (Storage::put($file_path.'/'.$filename, $file, 'public')) {
97 97
                     return $file_path.'/'.$filename;
98 98
                 } else {
99 99
                     throw new \Exception("Something went wrong, file can't upload!");
100 100
                 }
101 101
             }
102
-        }else{
102
+        } else{
103 103
             throw new \Exception("The file format is not allowed!");
104 104
         }
105 105
     }
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
                 if($filename && $ext) {
122 122
                     return $this->uploadFileProcess($filename, $ext, $encrypt, $resize_width, $resize_height);
123 123
                 }
124
-            }else {
124
+            } else {
125 125
                 throw new \Exception("Mime type not found");
126 126
             }
127
-        }else{
127
+        } else{
128 128
             throw new \Exception("Mime type not found");
129 129
         }
130 130
     }
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
             }
202 202
 
203 203
             Storage::put($fullFilePath, $img, 'public');
204
-        }else{
204
+        } else{
205 205
             throw new \Exception("The file format is not allowed!");
206 206
         }
207 207
     }
Please login to merge, or discard this patch.