Passed
Push — master ( e4ea99...6d7b4b )
by Nícollas
01:12
created
Source/Model/SimplePHP.class.php 3 patches
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -156,13 +156,17 @@
 block discarded – undo
156 156
             switch (!is_object($this->data) && $count = count($this->data)) {
157 157
                 case (!isset($this->data[0]) && !empty($this->data)):
158 158
                     foreach($this->excepts as $except) {
159
-                        if(isset($this->data[$except])) unset($this->data[$except]);
159
+                        if(isset($this->data[$except])) {
160
+                            unset($this->data[$except]);
161
+                        }
160 162
                     }
161 163
                     break;
162 164
                 case ($count >= 2 && isset($this->data[0])):
163 165
                     foreach($this->excepts as $except) {
164 166
                         for($i = 0; $i < $count; $i++) {
165
-                            if(isset($this->data[$i][$except])) unset($this->data[$i][$except]);
167
+                            if(isset($this->data[$i][$except])) {
168
+                                unset($this->data[$i][$except]);
169
+                            }
166 170
                         }
167 171
                     }
168 172
                     break;
Please login to merge, or discard this patch.
Switch Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -166,8 +166,8 @@
 block discarded – undo
166 166
                         }
167 167
                     }
168 168
                     break;
169
-            default:
170
-                return [];
169
+                default:
170
+                    return [];
171 171
             }
172 172
         }
173 173
     }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -10 removed lines patch added patch discarded remove patch
@@ -172,17 +172,17 @@  discard block
 block discarded – undo
172 172
      */
173 173
     private function deny()
174 174
     {
175
-        if(!empty($this->excepts)) {
175
+        if (!empty($this->excepts)) {
176 176
             switch (!is_object($this->data) && $count = count($this->data)) {
177 177
                 case (!isset($this->data[0]) && !empty($this->data)):
178
-                    foreach($this->excepts as $except) {
179
-                        if(isset($this->data[$except])) unset($this->data[$except]);
178
+                    foreach ($this->excepts as $except) {
179
+                        if (isset($this->data[$except])) unset($this->data[$except]);
180 180
                     }
181 181
                     break;
182 182
                 case ($count >= 2 && isset($this->data[0])):
183
-                    foreach($this->excepts as $except) {
184
-                        for($i = 0; $i < $count; $i++) {
185
-                            if(isset($this->data[$i][$except])) unset($this->data[$i][$except]);
183
+                    foreach ($this->excepts as $except) {
184
+                        for ($i = 0; $i < $count; $i++) {
185
+                            if (isset($this->data[$i][$except])) unset($this->data[$i][$except]);
186 186
                         }
187 187
                     }
188 188
                     break;
@@ -200,11 +200,10 @@  discard block
 block discarded – undo
200 200
         try {
201 201
             $execute = $this->conn->query("SELECT {$this->params} FROM {$this->table} {$this->where} {$this->order} {$this->limit} {$this->offset}");
202 202
             $execute->rowCount() > 1 ? 
203
-                    $this->data = ($this->type ? $execute->fetchAll(PDO::FETCH_CLASS, static::class) : $execute->fetchAll(PDO::FETCH_ASSOC)) :
204
-                    $this->data = ($this->type ? $execute->fetchObject(static::class) : $execute->fetch(PDO::FETCH_ASSOC));
203
+                    $this->data = ($this->type ? $execute->fetchAll(PDO::FETCH_CLASS, static::class) : $execute->fetchAll(PDO::FETCH_ASSOC)) : $this->data = ($this->type ? $execute->fetchObject(static::class) : $execute->fetch(PDO::FETCH_ASSOC));
205 204
             $this->deny();
206 205
             return $this->data;
207
-        } catch(PDOException $exc) {
206
+        } catch (PDOException $exc) {
208 207
             return $exc->getMessage();
209 208
         }
210 209
     }
@@ -214,7 +213,7 @@  discard block
 block discarded – undo
214 213
      */
215 214
     public function destroy() {
216 215
         $primary = $this->primary;
217
-        if(!isset($this->data->$primary)) {
216
+        if (!isset($this->data->$primary)) {
218 217
             throw new Exception("|| Índice primário não encontrado: {$primary} ||");
219 218
         }
220 219
         return $this->delete($this->data->$primary);
Please login to merge, or discard this patch.
Source/Model/CRUD.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
             $sql = $this->conn->prepare("DELETE FROM {$this->table} WHERE {$this->primary} = :primary");
14 14
             $sql->bindParam(':primary', $primary);
15 15
             return $sql->execute();
16
-        } catch(PDOException $exception) {
16
+        } catch (PDOException $exception) {
17 17
             return null;
18 18
         }
19 19
     }
Please login to merge, or discard this patch.