Passed
Push — master ( 2cb055...b2403f )
by Ferry
04:01
created
src/controllers/DeveloperUsersController.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,9 @@
 block discarded – undo
71 71
             $user = [];
72 72
             $user['name'] = request('name');
73 73
             $user['email'] = request('email');
74
-            if(request('password')) $user['password'] = Hash::make(request('password'));
74
+            if(request('password')) {
75
+                $user['password'] = Hash::make(request('password'));
76
+            }
75 77
             $user['cb_roles_id'] = request('cb_roles_id');
76 78
             DB::table('users')->where('id',$id)->update($user);
77 79
 
Please login to merge, or discard this patch.
src/helpers/Module.php 1 patch
Braces   +37 added lines, -22 removed lines patch added patch discarded remove patch
@@ -76,45 +76,60 @@  discard block
 block discarded – undo
76 76
 
77 77
     public function canBrowse() {
78 78
         if($this->privilege) {
79
-            if($this->privilege->can_browse) return true;
80
-            else return false;
81
-        }else{
79
+            if($this->privilege->can_browse) {
80
+                return true;
81
+            } else {
82
+                return false;
83
+            }
84
+        } else{
82 85
             return true;
83 86
         }
84 87
     }
85 88
 
86 89
     public function canCreate() {
87 90
         if($this->privilege) {
88
-            if($this->privilege->can_create) return true;
89
-            else return false;
90
-        }else{
91
+            if($this->privilege->can_create) {
92
+                return true;
93
+            } else {
94
+                return false;
95
+            }
96
+        } else{
91 97
             return true;
92 98
         }
93 99
     }
94 100
 
95 101
     public function canRead() {
96 102
         if($this->privilege) {
97
-            if($this->privilege->can_read) return true;
98
-            else return false;
99
-        }else{
103
+            if($this->privilege->can_read) {
104
+                return true;
105
+            } else {
106
+                return false;
107
+            }
108
+        } else{
100 109
             return true;
101 110
         }
102 111
     }
103 112
 
104 113
     public function canUpdate() {
105 114
         if($this->privilege) {
106
-            if($this->privilege->can_update) return true;
107
-            else return false;
108
-        }else{
115
+            if($this->privilege->can_update) {
116
+                return true;
117
+            } else {
118
+                return false;
119
+            }
120
+        } else{
109 121
             return true;
110 122
         }
111 123
     }
112 124
 
113 125
     public function canDelete() {
114 126
         if($this->privilege) {
115
-            if($this->privilege->can_delete) return true;
116
-            else return false;
117
-        }else{
127
+            if($this->privilege->can_delete) {
128
+                return true;
129
+            } else {
130
+                return false;
131
+            }
132
+        } else{
118 133
             return true;
119 134
         }
120 135
     }
@@ -123,7 +138,7 @@  discard block
 block discarded – undo
123 138
     {
124 139
         if($this->controller_class && method_exists($this->controller_class, 'getAdd')) {
125 140
             return action($this->controller.'@getAdd');
126
-        }else{
141
+        } else{
127 142
             return null;
128 143
         }
129 144
     }
@@ -132,7 +147,7 @@  discard block
 block discarded – undo
132 147
     {
133 148
         if($this->controller_class && method_exists($this->controller_class, 'postAddSave')) {
134 149
             return action($this->controller.'@postAddSave');
135
-        }else{
150
+        } else{
136 151
             return null;
137 152
         }
138 153
     }
@@ -141,7 +156,7 @@  discard block
 block discarded – undo
141 156
     {
142 157
         if($this->controller_class && method_exists($this->controller_class, 'getEdit')) {
143 158
             return action($this->controller.'@getEdit',['id'=>$id]);
144
-        }else{
159
+        } else{
145 160
             return null;
146 161
         }
147 162
     }
@@ -150,7 +165,7 @@  discard block
 block discarded – undo
150 165
     {
151 166
         if(method_exists($this->controller_class, 'postEditSave')) {
152 167
             return action($this->controller.'@postEditSave',['id'=>$id]);
153
-        }else{
168
+        } else{
154 169
             return null;
155 170
         }
156 171
     }
@@ -159,7 +174,7 @@  discard block
 block discarded – undo
159 174
     {
160 175
         if($this->controller_class && method_exists($this->controller_class, 'getDetail')) {
161 176
             return action($this->controller.'@getDetail',['id'=>$id]);
162
-        }else{
177
+        } else{
163 178
             return null;
164 179
         }
165 180
     }
@@ -168,7 +183,7 @@  discard block
 block discarded – undo
168 183
     {
169 184
         if($this->controller_class && method_exists($this->controller_class, 'getDelete')) {
170 185
             return action($this->controller.'@getDelete',['id'=>$id]);
171
-        }else{
186
+        } else{
172 187
             return null;
173 188
         }
174 189
     }
@@ -177,7 +192,7 @@  discard block
 block discarded – undo
177 192
     {
178 193
         if($this->controller_class && method_exists($this->controller_class, 'getIndex')) {
179 194
             return trim(action($this->controller.'@getIndex').'/'.$path,'/');
180
-        }else{
195
+        } else{
181 196
             return null;
182 197
         }
183 198
     }
Please login to merge, or discard this patch.
src/types/datetime/Hook.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     {
23 23
         if($column->getFormat()) {
24 24
             return date($column->getFormat(), strtotime($row->{$column->getField()}));
25
-        }else{
25
+        } else{
26 26
             return $row->{$column->getField()};
27 27
         }
28 28
     }
Please login to merge, or discard this patch.
src/types/radio/Radio.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         $data = DB::table($table);
37 37
         if($SQLCondition && is_callable($SQLCondition)) {
38 38
             $data = call_user_func($SQLCondition, $data);
39
-        }elseif ($SQLCondition && is_string($SQLCondition)) {
39
+        } elseif ($SQLCondition && is_string($SQLCondition)) {
40 40
             $data->whereRaw($SQLCondition);
41 41
         }
42 42
         $data = $data->get();
Please login to merge, or discard this patch.
src/types/checkbox/Checkbox.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         $data = DB::table($table);
37 37
         if($SQLCondition && is_callable($SQLCondition)) {
38 38
             $data = call_user_func($SQLCondition, $data);
39
-        }elseif ($SQLCondition && is_string($SQLCondition)) {
39
+        } elseif ($SQLCondition && is_string($SQLCondition)) {
40 40
             $data->whereRaw($SQLCondition);
41 41
         }
42 42
         $data = $data->get();
Please login to merge, or discard this patch.
src/types/date/Hook.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     {
23 23
         if($column->getFormat()) {
24 24
             return date($column->getFormat(), strtotime($row->{$column->getField()}));
25
-        }else{
25
+        } else{
26 26
             return $row->{$column->getField()};
27 27
         }
28 28
     }
Please login to merge, or discard this patch.
src/helpers/UserSession.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,11 @@
 block discarded – undo
28 28
     {
29 29
         $user = $this->user();
30 30
         $role = cb()->find("cb_roles", $user->cb_roles_id);
31
-        if($role) return $role->name;
32
-        else return null;
31
+        if($role) {
32
+            return $role->name;
33
+        } else {
34
+            return null;
35
+        }
33 36
     }
34 37
 
35 38
     public function roleId()
Please login to merge, or discard this patch.
src/controllers/scaffolding/singletons/ColumnSingleton.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             /** @var ColumnModel $column */
50 50
             if($data_row) {
51 51
                 $value = (isset($data_row->{$column->getField()}))?$data_row->{ $column->getField() }:null;
52
-            }else{
52
+            } else{
53 53
                 $value = request($column->getName());
54 54
 
55 55
                 if(!$value && $column->getDefaultValue()) {
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
                 foreach($column->getValue() as $key=>$val) {
140 140
                     $data[$key] = $val;
141 141
                 }
142
-            }else{
142
+            } else{
143 143
                 $data[$column->getField()] = $column->getValue();
144 144
             }
145 145
         }
Please login to merge, or discard this patch.
src/commands/MigrateData.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
             $this->info("== Generating Seeder ==");
37 37
             $this->generateSeeder();
38 38
             $this->info("== Finish ==");
39
-        }else{
39
+        } else{
40 40
             $this->info("== Importing the seeder ==");
41 41
             $this->call("db:seed",["--class"=>"CbMigrationSeeder"]);
42 42
             $this->info("== Finish ==");
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $composer_path = '';
92 92
         if (file_exists(getcwd().'/composer.phar')) {
93 93
             $composer_path = '"'.PHP_BINARY.'" '.getcwd().'/composer.phar';
94
-        }else{
94
+        } else{
95 95
             $composer_path = 'composer';
96 96
         }
97 97
 
Please login to merge, or discard this patch.