Passed
Push — main ( 46dc6a...1f4681 )
by BRUNO
01:56
created
src/CrudBuilder.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
     private function orderBy(string $parameter, $order = null): self
187 187
     {
188 188
         try {
189
-            $query = "ORDER BY {$parameter} ".($order ?? 'ASC');
189
+            $query = "ORDER BY {$parameter} " . ($order ?? 'ASC');
190 190
             $this->add($query, "orderBy");
191 191
             return $this;
192 192
         } catch (\PDOException $e) {
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
     private function addOrderBy(string $parameter, $order = null): self
198 198
     {
199 199
         try {
200
-            $query = ", {$parameter} ".($order ?? 'ASC')." ";
200
+            $query = ", {$parameter} " . ($order ?? 'ASC') . " ";
201 201
             $this->add($query, "addOrderBy");
202 202
             return $this;
203 203
         } catch (\PDOException $e) {
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
     private function limit(string $texto): self
213 213
     {
214 214
         $query = "LIMIT {$texto}";
215
-        $this->add($query,"limit");
215
+        $this->add($query, "limit");
216 216
         return $this;
217 217
     }
218 218
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
     {
225 225
         try {
226 226
             $query = "OFFSET {$texto}";
227
-            $this->add($query,"offset");
227
+            $this->add($query, "offset");
228 228
             return $this;
229 229
         } catch (\PDOException $e) {
230 230
             $this->setError($e);
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
     {
240 240
         try {
241 241
             $query = "GROUP BY {$texto}";
242
-            $this->add($query,"groupBy");
242
+            $this->add($query, "groupBy");
243 243
             return $this;
244 244
         } catch (\PDOException $e) {
245 245
             $this->setError($e);
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     {
255 255
         try {
256 256
             $query = "HAVING {$texto}";
257
-            $this->add($query,"having");
257
+            $this->add($query, "having");
258 258
             return $this;
259 259
         } catch (\PDOException $e) {
260 260
             $this->setError($e);
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
     {
270 270
         try {
271 271
             $query = "AND {$texto}";
272
-            $this->add($query,"andHaving");
272
+            $this->add($query, "andHaving");
273 273
             return $this;
274 274
         } catch (\PDOException $e) {
275 275
             $this->setError($e);
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
     {
285 285
         try {
286 286
             $query = "OR {$codition}";
287
-            $this->add($query,"orHaving");
287
+            $this->add($query, "orHaving");
288 288
             return $this;
289 289
         } catch (\PDOException $e) {
290 290
             $this->setError($e);
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
     {
302 302
         try {
303 303
             $query = "INNER JOIN {$table} AS {$alias} ON $codition";
304
-            $this->add($query,"join");
304
+            $this->add($query, "join");
305 305
             return $this;
306 306
         } catch (\PDOException $e) {
307 307
             $this->setError($e);
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
     {
319 319
         try {
320 320
             $query = "LEFT JOIN {$table} AS {$alias} ON {$codition}";
321
-            $this->add($query,"join");
321
+            $this->add($query, "join");
322 322
             return $this;
323 323
         } catch (\PDOException $e) {
324 324
             $this->setError($e);
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
     {
336 336
         try {
337 337
             $query = "RIGHT JOIN {$table} AS {$alias} ON $codition";
338
-            $this->add($query,"join");
338
+            $this->add($query, "join");
339 339
             return $this;
340 340
         } catch (\PDOException $e) {
341 341
             $this->setError($e);
@@ -348,9 +348,9 @@  discard block
 block discarded – undo
348 348
     private function executeQuery(): self
349 349
     {
350 350
         try {
351
-            foreach ($this->sqlPartsSelect as $key => $part){
351
+            foreach ($this->sqlPartsSelect as $key => $part) {
352 352
                 if (is_array($part)) {
353
-                    foreach ($part as $item){
353
+                    foreach ($part as $item) {
354 354
                         $this->query .= $item;
355 355
                     }
356 356
                 } else {
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
      */
422 422
     private function add(string $query, string $type, array $params = []): void
423 423
     {
424
-        $query = $query." ";
424
+        $query = $query . " ";
425 425
         try {
426 426
             if (is_array($this->sqlPartsSelect[$type])) {
427 427
                 $this->sqlPartsSelect[$type][] = $query;
Please login to merge, or discard this patch.