Passed
Push — main ( 914853...3912a5 )
by BRUNO
01:57
created
src/ModelAbstract.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
         }
88 88
 
89 89
         return $classname . ' {' . implode(', ', array_map(
90
-            function ($p_0) use ($data) {
90
+            function($p_0) use ($data) {
91 91
                 $p_0->setAccessible(true);
92 92
 
93 93
                 return $p_0->getName() . ': ' . $p_0->getValue($data);
Please login to merge, or discard this patch.
src/DatalayerTrait.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@
 block discarded – undo
164 164
             $prepare = empty($prepare) ? $this->prepare : $prepare;
165 165
             return $prepare->rowCount();
166 166
         } catch (PDOException $e) {
167
-            $this->setError($e);}
167
+            $this->setError($e); }
168 168
     }
169 169
 
170 170
     /**
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -132,8 +132,9 @@
 block discarded – undo
132 132
      */
133 133
     protected function setTable(string $tableName, string $tableAlias = ""): self
134 134
     {
135
-        if (!empty($tableAlias))
136
-            $this->tableAlias = $tableAlias;
135
+        if (!empty($tableAlias)) {
136
+                    $this->tableAlias = $tableAlias;
137
+        }
137 138
         $this->tableName = $tableName;
138 139
         return $this;
139 140
     }
Please login to merge, or discard this patch.
src/Crud.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      */
28 28
     public function select(string $fields = '*', string $add = '', array $values = null, bool $returnModel = false, bool $debug = false)
29 29
     {
30
-        if (strlen($add) > 0) {
30
+        if (strlen($add)>0) {
31 31
             $add = ' ' . $add;
32 32
         }
33 33
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         $numparams = substr($numparams, 1);
67 67
         $sql = "INSERT INTO {$this->getTable()} ({$fields}) VALUES ({$numparams})";
68 68
         if ($debug) {
69
-            echo $sql.'<pre>'.print_r($values).'</pre>';
69
+            echo $sql . '<pre>' . print_r($values) . '</pre>';
70 70
             return;
71 71
         }
72 72
         $result = $this->executeSQL($sql, $values);
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             $sql .= " WHERE $where";
149 149
         }
150 150
         if ($debug) {
151
-            echo $sql.'<pre>'.print_r($values).'</pre>';
151
+            echo $sql . '<pre>' . print_r($values) . '</pre>';
152 152
             return;
153 153
         }
154 154
         $result = $this->executeSQL($sql, $values);
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
             $sql .= " WHERE $where";
224 224
         }
225 225
         if ($debug) {
226
-            echo $sql.'<pre>'.print_r($values).'</pre>';
226
+            echo $sql . '<pre>' . print_r($values) . '</pre>';
227 227
             return;
228 228
         }
229 229
         $result = $this->executeSQL($sql, $values);
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,8 +33,9 @@
 block discarded – undo
33 33
 
34 34
         $sql = "SELECT {$fields} FROM {$this->getTable()}";
35 35
 
36
-        if (!empty($this->getTableAlias()))
37
-            $sql .= " AS {$this->getTableAlias()}";
36
+        if (!empty($this->getTableAlias())) {
37
+                    $sql .= " AS {$this->getTableAlias()}";
38
+        }
38 39
 
39 40
         $sql .= "{$add}";
40 41
 
Please login to merge, or discard this patch.
src/CrudBuilder.php 2 patches
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
     use DatalayerTrait;
18 18
 
19 19
     /**
20
-    * @param string $fields
21
-    * @param array $paramns
22
-    * @return $this
20
+     * @param string $fields
21
+     * @param array $paramns
22
+     * @return $this
23 23
      */
24 24
     public function select(string $fields = "*", array $paramns = []): CrudBuilder
25 25
     {
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
     }
36 36
 
37 37
     /**
38
-    * @param string $fields
39
-    * @param array $paramns
40
-    * @return $this
38
+     * @param string $fields
39
+     * @param array $paramns
40
+     * @return $this
41 41
      */
42 42
     public function insert(string $fields, array $paramns): self
43 43
     {
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
     }
57 57
 
58 58
     /**
59
-    * @param string $fields
60
-    * @param array $paramns
61
-    * @return $this
59
+     * @param string $fields
60
+     * @param array $paramns
61
+     * @return $this
62 62
      */
63 63
     public function update(string $fields, array $paramns): self
64 64
     {
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
     }
80 80
 
81 81
     /**
82
-    * @param string $fields
83
-    * @param array $paramns
84
-    * @return $this
82
+     * @param string $fields
83
+     * @param array $paramns
84
+     * @return $this
85 85
      */
86 86
     public function delete(string $fields, array $paramns): self
87 87
     {
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
     }
96 96
 
97 97
     /**
98
-    * @param string $texto
99
-    * @param array $paramns
100
-    * @return $this
98
+     * @param string $texto
99
+     * @param array $paramns
100
+     * @return $this
101 101
      */
102 102
     public function query(string $texto, array $paramns = []): self
103 103
     {
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
     }
111 111
 
112 112
     /**
113
-    * @param string $texto
114
-    * @param array $paramns
115
-    * @return $this
113
+     * @param string $texto
114
+     * @param array $paramns
115
+     * @return $this
116 116
      */
117 117
     public function where(string $texto, array $paramns = []): self
118 118
     {
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
     }
127 127
 
128 128
     /**
129
-    * @param string $condition
130
-    * @param array $paramns
131
-    * @return $this
129
+     * @param string $condition
130
+     * @param array $paramns
131
+     * @return $this
132 132
      */
133 133
     public function andWhere(string $condition, array $paramns = []): self
134 134
     {
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
     }
143 143
 
144 144
     /**
145
-    * @param string $texto
146
-    * @param array $paramns
147
-    * @return $this
145
+     * @param string $texto
146
+     * @param array $paramns
147
+     * @return $this
148 148
      */
149 149
     public function orWhere(string $texto, array $paramns = []): self
150 150
     {
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
     }
159 159
 
160 160
     /**
161
-    * @param string $texto
162
-    * @return $this
161
+     * @param string $texto
162
+     * @return $this
163 163
      */
164 164
     public function orderBy(string $texto): self
165 165
     {
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
     }
174 174
 
175 175
     /**
176
-    * @param string $texto
177
-    * @return $this
176
+     * @param string $texto
177
+     * @return $this
178 178
      */
179 179
     public function limit(string $texto): self
180 180
     {
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
     }
185 185
 
186 186
     /**
187
-    * @param string $texto
188
-    * @return $this
187
+     * @param string $texto
188
+     * @return $this
189 189
      */
190 190
     public function offset(string $texto): self
191 191
     {
@@ -199,8 +199,8 @@  discard block
 block discarded – undo
199 199
     }
200 200
 
201 201
     /**
202
-    * @param string $texto
203
-    * @return $this
202
+     * @param string $texto
203
+     * @return $this
204 204
      */
205 205
     public function groupBy(string $texto): self
206 206
     {
@@ -214,8 +214,8 @@  discard block
 block discarded – undo
214 214
     }
215 215
 
216 216
     /**
217
-    * @param string $texto
218
-    * @return $this
217
+     * @param string $texto
218
+     * @return $this
219 219
      */
220 220
     public function having(string $texto): self
221 221
     {
@@ -229,10 +229,10 @@  discard block
 block discarded – undo
229 229
     }
230 230
 
231 231
     /**
232
-    * @param string $table
233
-    * @param string $alias
234
-    * @param string $codition
235
-    * @return $this
232
+     * @param string $table
233
+     * @param string $alias
234
+     * @param string $codition
235
+     * @return $this
236 236
      */
237 237
     public function innerJoin(string $table, string $alias, string $codition): self
238 238
     {
@@ -246,10 +246,10 @@  discard block
 block discarded – undo
246 246
     }
247 247
 
248 248
     /**
249
-    * @param string $table
250
-    * @param string $alias
251
-    * @param string $codition
252
-    * @return $this
249
+     * @param string $table
250
+     * @param string $alias
251
+     * @param string $codition
252
+     * @return $this
253 253
      */
254 254
     public function leftJoin(string $table, string $alias, string $codition): self
255 255
     {
@@ -263,10 +263,10 @@  discard block
 block discarded – undo
263 263
     }
264 264
 
265 265
     /**
266
-    * @param string $table
267
-    * @param string $alias
268
-    * @param string $codition
269
-    * @return $this
266
+     * @param string $table
267
+     * @param string $alias
268
+     * @param string $codition
269
+     * @return $this
270 270
      */
271 271
     public function rightJoin(string $table, string $alias, string $codition): self
272 272
     {
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
     }
294 294
 
295 295
     /**
296
-    * @return void
296
+     * @return void
297 297
      */
298 298
     public function debug()
299 299
     {
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,8 +25,9 @@  discard block
 block discarded – undo
25 25
     {
26 26
         try {
27 27
             $query = "SELECT {$fields} FROM {$this->getTable()} ";
28
-            if (!empty($this->getTableAlias()))
29
-                $query .= "AS {$this->getTableAlias()} ";
28
+            if (!empty($this->getTableAlias())) {
29
+                            $query .= "AS {$this->getTableAlias()} ";
30
+            }
30 31
             $this->add($query, $paramns);
31 32
             return $this;
32 33
         } catch (\PDOException $e) {
@@ -332,8 +333,9 @@  discard block
 block discarded – undo
332 333
     private function add(string $text, array $params = [])
333 334
     {
334 335
         try {
335
-            if (!empty($params))
336
-                $this->params = array_merge($this->params, $params);
336
+            if (!empty($params)) {
337
+                            $this->params = array_merge($this->params, $params);
338
+            }
337 339
             $this->query .= $text;
338 340
         } catch (\PDOException $e) {
339 341
             $this->setError($e);
Please login to merge, or discard this patch.