Passed
Push — main ( 93ac90...348036 )
by BRUNO
01:57
created
src/CrudBuilder.php 2 patches
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -36,13 +36,13 @@  discard block
 block discarded – undo
36 36
 
37 37
     /**
38 38
      *
39
-    * <code>
40
-    *   $qb = $this->select('u.id, p.id')
41
-    *           ->where('phonenumbers=?', [$number]);
42
-    * </code>
43
-    * @param string $fields
44
-    * @param array $paramns
45
-    * @return $this
39
+     * <code>
40
+     *   $qb = $this->select('u.id, p.id')
41
+     *           ->where('phonenumbers=?', [$number]);
42
+     * </code>
43
+     * @param string $fields
44
+     * @param array $paramns
45
+     * @return $this
46 46
      */
47 47
     public function select(string $fields = "*", array $paramns = []): CrudBuilder
48 48
     {
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
     }
59 59
 
60 60
     /**
61
-    * @param string $fields
62
-    * @param array $paramns
63
-    * @return $this
61
+     * @param string $fields
62
+     * @param array $paramns
63
+     * @return $this
64 64
      */
65 65
     public function insert(string $fields, array $paramns): self
66 66
     {
@@ -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 update(string $fields, array $paramns): self
87 87
     {
@@ -102,9 +102,9 @@  discard block
 block discarded – undo
102 102
     }
103 103
 
104 104
     /**
105
-    * @param string $fields
106
-    * @param array $paramns
107
-    * @return $this
105
+     * @param string $fields
106
+     * @param array $paramns
107
+     * @return $this
108 108
      */
109 109
     public function delete(): self
110 110
     {
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
     }
119 119
 
120 120
     /**
121
-    * @param string $query
122
-    * @param array $paramns
123
-    * @return $this
121
+     * @param string $query
122
+     * @param array $paramns
123
+     * @return $this
124 124
      */
125 125
     public function query(string $query, array $paramns = []): self
126 126
     {
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
133 133
     }
134 134
 
135 135
     /**
136
-    * @param string $texto
137
-    * @param array $paramns
138
-    * @return $this
136
+     * @param string $texto
137
+     * @param array $paramns
138
+     * @return $this
139 139
      */
140 140
     public function where(string $texto, array $paramns = []): self
141 141
     {
@@ -149,9 +149,9 @@  discard block
 block discarded – undo
149 149
     }
150 150
 
151 151
     /**
152
-    * @param string $condition
153
-    * @param array $paramns
154
-    * @return $this
152
+     * @param string $condition
153
+     * @param array $paramns
154
+     * @return $this
155 155
      */
156 156
     public function andWhere(string $condition, array $paramns = []): self
157 157
     {
@@ -165,9 +165,9 @@  discard block
 block discarded – undo
165 165
     }
166 166
 
167 167
     /**
168
-    * @param string $condition
169
-    * @param array $paramns
170
-    * @return $this
168
+     * @param string $condition
169
+     * @param array $paramns
170
+     * @return $this
171 171
      */
172 172
     public function orWhere(string $condition, array $paramns = []): self
173 173
     {
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
     }
182 182
 
183 183
     /**
184
-    * @param string $parameter
185
-    * @return $this
184
+     * @param string $parameter
185
+     * @return $this
186 186
      */
187 187
     public function orderBy(string $parameter, $order = null): self
188 188
     {
@@ -207,8 +207,8 @@  discard block
 block discarded – undo
207 207
     }
208 208
 
209 209
     /**
210
-    * @param string $texto
211
-    * @return $this
210
+     * @param string $texto
211
+     * @return $this
212 212
      */
213 213
     public function limit(string $texto): self
214 214
     {
@@ -218,8 +218,8 @@  discard block
 block discarded – undo
218 218
     }
219 219
 
220 220
     /**
221
-    * @param string $texto
222
-    * @return $this
221
+     * @param string $texto
222
+     * @return $this
223 223
      */
224 224
     public function offset(string $texto): self
225 225
     {
@@ -233,8 +233,8 @@  discard block
 block discarded – undo
233 233
     }
234 234
 
235 235
     /**
236
-    * @param string $texto
237
-    * @return $this
236
+     * @param string $texto
237
+     * @return $this
238 238
      */
239 239
     public function groupBy(string $texto): self
240 240
     {
@@ -248,8 +248,8 @@  discard block
 block discarded – undo
248 248
     }
249 249
 
250 250
     /**
251
-    * @param string $texto
252
-    * @return $this
251
+     * @param string $texto
252
+     * @return $this
253 253
      */
254 254
     public function having(string $texto): self
255 255
     {
@@ -293,10 +293,10 @@  discard block
 block discarded – undo
293 293
     }
294 294
 
295 295
     /**
296
-    * @param string $table
297
-    * @param string $alias
298
-    * @param string $codition
299
-    * @return $this
296
+     * @param string $table
297
+     * @param string $alias
298
+     * @param string $codition
299
+     * @return $this
300 300
      */
301 301
     public function innerJoin(string $table, string $alias, string $codition): self
302 302
     {
@@ -310,10 +310,10 @@  discard block
 block discarded – undo
310 310
     }
311 311
 
312 312
     /**
313
-    * @param string $table
314
-    * @param string $alias
315
-    * @param string $codition
316
-    * @return $this
313
+     * @param string $table
314
+     * @param string $alias
315
+     * @param string $codition
316
+     * @return $this
317 317
      */
318 318
     public function leftJoin(string $table, string $alias, string $codition): self
319 319
     {
@@ -327,10 +327,10 @@  discard block
 block discarded – undo
327 327
     }
328 328
 
329 329
     /**
330
-    * @param string $table
331
-    * @param string $alias
332
-    * @param string $codition
333
-    * @return $this
330
+     * @param string $table
331
+     * @param string $alias
332
+     * @param string $codition
333
+     * @return $this
334 334
      */
335 335
     public function rightJoin(string $table, string $alias, string $codition): self
336 336
     {
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
     }
369 369
 
370 370
     /**
371
-    * @return void
371
+     * @return void
372 372
      */
373 373
     public function debug()
374 374
     {
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
     public function orderBy(string $parameter, $order = null): self
188 188
     {
189 189
         try {
190
-            $query = "ORDER BY {$parameter} ".($order ?? 'ASC');
190
+            $query = "ORDER BY {$parameter} " . ($order ?? 'ASC');
191 191
             $this->add($query, "orderBy");
192 192
             return $this;
193 193
         } catch (\PDOException $e) {
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
     public function addOrderBy(string $parameter, $order = null): self
199 199
     {
200 200
         try {
201
-            $query = ", {$parameter} ".($order ?? 'ASC')." ";
201
+            $query = ", {$parameter} " . ($order ?? 'ASC') . " ";
202 202
             $this->add($query, "addOrderBy");
203 203
             return $this;
204 204
         } catch (\PDOException $e) {
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
     public function limit(string $texto): self
214 214
     {
215 215
         $query = "LIMIT {$texto}";
216
-        $this->add($query,"limit");
216
+        $this->add($query, "limit");
217 217
         return $this;
218 218
     }
219 219
 
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
     {
226 226
         try {
227 227
             $query = "OFFSET {$texto}";
228
-            $this->add($query,"offset");
228
+            $this->add($query, "offset");
229 229
             return $this;
230 230
         } catch (\PDOException $e) {
231 231
             $this->setError($e);
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
     {
241 241
         try {
242 242
             $query = "GROUP BY {$texto}";
243
-            $this->add($query,"groupBy");
243
+            $this->add($query, "groupBy");
244 244
             return $this;
245 245
         } catch (\PDOException $e) {
246 246
             $this->setError($e);
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
     {
256 256
         try {
257 257
             $query = "HAVING {$texto}";
258
-            $this->add($query,"having");
258
+            $this->add($query, "having");
259 259
             return $this;
260 260
         } catch (\PDOException $e) {
261 261
             $this->setError($e);
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
     {
271 271
         try {
272 272
             $query = "AND {$texto}";
273
-            $this->add($query,"andHaving");
273
+            $this->add($query, "andHaving");
274 274
             return $this;
275 275
         } catch (\PDOException $e) {
276 276
             $this->setError($e);
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
     {
286 286
         try {
287 287
             $query = "OR {$codition}";
288
-            $this->add($query,"orHaving");
288
+            $this->add($query, "orHaving");
289 289
             return $this;
290 290
         } catch (\PDOException $e) {
291 291
             $this->setError($e);
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
     {
303 303
         try {
304 304
             $query = "INNER JOIN {$table} AS {$alias} ON $codition";
305
-            $this->add($query,"join");
305
+            $this->add($query, "join");
306 306
             return $this;
307 307
         } catch (\PDOException $e) {
308 308
             $this->setError($e);
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
     {
320 320
         try {
321 321
             $query = "LEFT JOIN {$table} AS {$alias} ON {$codition}";
322
-            $this->add($query,"join");
322
+            $this->add($query, "join");
323 323
             return $this;
324 324
         } catch (\PDOException $e) {
325 325
             $this->setError($e);
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
     {
337 337
         try {
338 338
             $query = "RIGHT JOIN {$table} AS {$alias} ON $codition";
339
-            $this->add($query,"join");
339
+            $this->add($query, "join");
340 340
             return $this;
341 341
         } catch (\PDOException $e) {
342 342
             $this->setError($e);
@@ -349,9 +349,9 @@  discard block
 block discarded – undo
349 349
     public function executeQuery(): self
350 350
     {
351 351
         try {
352
-            foreach ($this->sqlPartsSelect as $key => $part){
352
+            foreach ($this->sqlPartsSelect as $key => $part) {
353 353
                 if (is_array($part)) {
354
-                    foreach ($part as $item){
354
+                    foreach ($part as $item) {
355 355
                         $this->query .= $item;
356 356
                     }
357 357
                 } else {
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 
413 413
     private function add(string $text, string $type, array $params = [])
414 414
     {
415
-        $text = $text." ";
415
+        $text = $text . " ";
416 416
         try {
417 417
             if (is_array($this->sqlPartsSelect[$type])) {
418 418
                 $this->sqlPartsSelect[$type][] = $text;
Please login to merge, or discard this patch.