Passed
Push — master ( 96f43f...70d075 )
by Ferry
15:33
created
src/helpers/Module.php 1 patch
Braces   +37 added lines, -22 removed lines patch added patch discarded remove patch
@@ -90,45 +90,60 @@  discard block
 block discarded – undo
90 90
 
91 91
     public function canBrowse() {
92 92
         if($this->privilege) {
93
-            if($this->privilege->can_browse) return true;
94
-            else return false;
95
-        }else{
93
+            if($this->privilege->can_browse) {
94
+                return true;
95
+            } else {
96
+                return false;
97
+            }
98
+        } else{
96 99
             return true;
97 100
         }
98 101
     }
99 102
 
100 103
     public function canCreate() {
101 104
         if($this->privilege) {
102
-            if($this->privilege->can_create) return true;
103
-            else return false;
104
-        }else{
105
+            if($this->privilege->can_create) {
106
+                return true;
107
+            } else {
108
+                return false;
109
+            }
110
+        } else{
105 111
             return true;
106 112
         }
107 113
     }
108 114
 
109 115
     public function canRead() {
110 116
         if($this->privilege) {
111
-            if($this->privilege->can_read) return true;
112
-            else return false;
113
-        }else{
117
+            if($this->privilege->can_read) {
118
+                return true;
119
+            } else {
120
+                return false;
121
+            }
122
+        } else{
114 123
             return true;
115 124
         }
116 125
     }
117 126
 
118 127
     public function canUpdate() {
119 128
         if($this->privilege) {
120
-            if($this->privilege->can_update) return true;
121
-            else return false;
122
-        }else{
129
+            if($this->privilege->can_update) {
130
+                return true;
131
+            } else {
132
+                return false;
133
+            }
134
+        } else{
123 135
             return true;
124 136
         }
125 137
     }
126 138
 
127 139
     public function canDelete() {
128 140
         if($this->privilege) {
129
-            if($this->privilege->can_delete) return true;
130
-            else return false;
131
-        }else{
141
+            if($this->privilege->can_delete) {
142
+                return true;
143
+            } else {
144
+                return false;
145
+            }
146
+        } else{
132 147
             return true;
133 148
         }
134 149
     }
@@ -137,7 +152,7 @@  discard block
 block discarded – undo
137 152
     {
138 153
         if($this->controller_class && method_exists($this->controller_class, 'getAdd')) {
139 154
             return action($this->controller.'@getAdd');
140
-        }else{
155
+        } else{
141 156
             return null;
142 157
         }
143 158
     }
@@ -146,7 +161,7 @@  discard block
 block discarded – undo
146 161
     {
147 162
         if($this->controller_class && method_exists($this->controller_class, 'postAddSave')) {
148 163
             return action($this->controller.'@postAddSave');
149
-        }else{
164
+        } else{
150 165
             return null;
151 166
         }
152 167
     }
@@ -155,7 +170,7 @@  discard block
 block discarded – undo
155 170
     {
156 171
         if($this->controller_class && method_exists($this->controller_class, 'getEdit')) {
157 172
             return action($this->controller.'@getEdit')."/".$id;
158
-        }else{
173
+        } else{
159 174
             return null;
160 175
         }
161 176
     }
@@ -164,7 +179,7 @@  discard block
 block discarded – undo
164 179
     {
165 180
         if(method_exists($this->controller_class, 'postEditSave')) {
166 181
             return action($this->controller.'@postEditSave')."/".$id;
167
-        }else{
182
+        } else{
168 183
             return null;
169 184
         }
170 185
     }
@@ -173,7 +188,7 @@  discard block
 block discarded – undo
173 188
     {
174 189
         if($this->controller_class && method_exists($this->controller_class, 'getDetail')) {
175 190
             return action($this->controller.'@getDetail')."/".$id;
176
-        }else{
191
+        } else{
177 192
             return null;
178 193
         }
179 194
     }
@@ -182,7 +197,7 @@  discard block
 block discarded – undo
182 197
     {
183 198
         if($this->controller_class && method_exists($this->controller_class, 'getDelete')) {
184 199
             return action($this->controller.'@getDelete')."/".$id;
185
-        }else{
200
+        } else{
186 201
             return null;
187 202
         }
188 203
     }
@@ -191,7 +206,7 @@  discard block
 block discarded – undo
191 206
     {
192 207
         if($this->controller_class && method_exists($this->controller_class, 'getIndex')) {
193 208
             return trim(action($this->controller.'@getIndex').'/'.$path,'/');
194
-        }else{
209
+        } else{
195 210
             return null;
196 211
         }
197 212
     }
Please login to merge, or discard this patch.
src/controllers/traits/Query.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
                     if(SchemaHelper::hasColumn($this->data['table'], $column->getField())) {
49 49
                         $query->addSelect($this->data['table'].'.'.$column->getField());
50 50
                     }
51
-                }else{
51
+                } else{
52 52
                     $query->addSelect($column->getField());
53 53
                 }
54 54
             }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             $keyword = sanitizeXSS(request("q"));
69 69
             if(isset($this->data['hook_search_query'])) {
70 70
                 $query = call_user_func($this->data['hook_search_query'], $query, $keyword);
71
-            }else{
71
+            } else{
72 72
                 $query->where(function ($where) use ($columns, $keyword) {
73 73
                     /**
74 74
                      * @var $where Builder
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
                     {
78 78
                         if(strpos($column->getField(),".") === false) {
79 79
                             $field = $this->data['table'].'.'.$column->getField();
80
-                        }else{
80
+                        } else{
81 81
                             $field = $column->getField();
82 82
                         }
83 83
                         $where->orWhere($field, 'like', '%'.$keyword.'%');
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
                     $query->orderBy(request('order_by'), request('order_sort'));
120 120
                 }
121 121
             }
122
-        }else{
122
+        } else{
123 123
             /*
124 124
              * For default, query will be order by primary key as descending
125 125
              */
Please login to merge, or discard this patch.
src/helpers/CurlHelper.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,9 @@  discard block
 block discarded – undo
72 72
         curl_setopt($ch, CURLOPT_REFERER, $this->referer);
73 73
         if($this->cookie === true) {
74 74
             $cookie_dir = storage_path("cookies");
75
-            if(!file_exists($cookie_dir)) mkdir($cookie_dir);
75
+            if(!file_exists($cookie_dir)) {
76
+                mkdir($cookie_dir);
77
+            }
76 78
             $cookie_file = $cookie_dir."/".md5(request()->ip()).".txt";
77 79
             curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
78 80
             curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
@@ -84,7 +86,7 @@  discard block
 block discarded – undo
84 86
 
85 87
         if($err) {
86 88
             return $err;
87
-        }else {
89
+        } else {
88 90
             return $response;
89 91
         }
90 92
     }
Please login to merge, or discard this patch.
src/controllers/CBController.php 1 patch
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
                     $columns_table[$index]['type_data'] = CRUDBooster::getFieldType($table, $field);
364 364
                     $columns_table[$index]['field'] = $table.'_'.$field;
365 365
                     $columns_table[$index]['field_raw'] = $table.'.'.$field;
366
-                }else{
366
+                } else{
367 367
                     $result->addselect($table.'.'.$field);
368 368
                     $columns_table[$index]['type_data'] = CRUDBooster::getFieldType($table, $field);
369 369
                     $columns_table[$index]['field'] = $field;
@@ -1154,8 +1154,9 @@  discard block
 block discarded – undo
1154 1154
         $lastInsertId = $id = DB::table($this->table)->insertGetId($this->arr);
1155 1155
         
1156 1156
         //fix bug if primary key is uuid
1157
-        if($this->arr[$this->primary_key]!=$id)
1158
-            $id = $this->arr[$this->primary_key];
1157
+        if($this->arr[$this->primary_key]!=$id) {
1158
+                    $id = $this->arr[$this->primary_key];
1159
+        }
1159 1160
         
1160 1161
         //Looping Data Input Again After Insert
1161 1162
         foreach ($this->data_inputan as $ro) {
@@ -1350,7 +1351,9 @@  discard block
 block discarded – undo
1350 1351
                 }
1351 1352
                 if ($ro['relationship_table'] && $ro["datatable_orig"] != "") {
1352 1353
                     $params = explode("|", $ro['datatable_orig']);
1353
-                    if(!isset($params[2])) $params[2] = "id";
1354
+                    if(!isset($params[2])) {
1355
+                        $params[2] = "id";
1356
+                    }
1354 1357
                     DB::table($params[0])->where($params[2], $id)->update([$params[1] => implode(",",$inputdata)]);
1355 1358
                 }
1356 1359
             }
Please login to merge, or discard this patch.
src/views/module_generator/step3.blade.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -502,22 +502,28 @@
 block discarded – undo
502 502
 
503 503
                                     </div>
504 504
 
505
-                                    <?php else:?>
505
+                                    <?php else {
506
+    :?>
506 507
 
507 508
                                     <div class="form-group">
508 509
                                         <label>{{$key}}</label>
509 510
                                         <input type="text" name="option[{{$index}}][{{$key}}]" placeholder="{{$val->placeholder}}" value="{{$value}}"
510 511
                                                class="form-control">
511 512
                                     </div>
512
-                                    <?php endif;?>
513
-                                    <?php else:?>
513
+                                    <?php endif;
514
+}
515
+?>
516
+                                    <?php else {
517
+    :?>
514 518
 
515 519
                                     <div class="form-group">
516 520
                                         <label>{{$key}}</label>
517 521
                                         <input type="text" name="option[{{$index}}][{{$key}}]" placeholder="{{$val}}" value="{{$value}}" class="form-control">
518 522
                                     </div>
519 523
 
520
-                                    <?php endif;?>
524
+                                    <?php endif;
525
+}
526
+?>
521 527
                                     <?php endforeach; endif;?>
522 528
 
523 529
 
Please login to merge, or discard this patch.