Completed
Push — master ( 233141...899014 )
by Arjay
03:30
created
src/Engines/QueryBuilderEngine.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -96,13 +96,13 @@  discard block
 block discarded – undo
96 96
         $myQuery = clone $this->query;
97 97
         // if its a normal query ( no union, having and distinct word )
98 98
         // replace the select with static text to improve performance
99
-        if (! Str::contains(Str::lower($myQuery->toSql()), ['union', 'having', 'distinct', 'order by', 'group by'])) {
99
+        if (!Str::contains(Str::lower($myQuery->toSql()), ['union', 'having', 'distinct', 'order by', 'group by'])) {
100 100
             $row_count = $this->wrap('row_count');
101 101
             $myQuery->select($this->connection->raw("'1' as {$row_count}"));
102 102
         }
103 103
 
104 104
         // check for select soft deleted records
105
-        if (! $this->withTrashed && $this->modelUseSoftDeletes()) {
105
+        if (!$this->withTrashed && $this->modelUseSoftDeletes()) {
106 106
             $myQuery->whereNull($myQuery->getModel()->getTable() . '.deleted_at');
107 107
         }
108 108
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
                         $columnDef = $this->columnDef['filter'][$columnName];
159 159
                         // check if global search should be applied for the specific column
160 160
                         $applyGlobalSearch = count($columnDef['parameters']) == 0 || end($columnDef['parameters']) !== false;
161
-                        if (! $applyGlobalSearch) {
161
+                        if (!$applyGlobalSearch) {
162 162
                             continue;
163 163
                         }
164 164
 
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
         $columns = $this->request->get('columns', []);
359 359
 
360 360
         foreach ($columns as $index => $column) {
361
-            if (! $this->request->isColumnSearchable($index)) {
361
+            if (!$this->request->isColumnSearchable($index)) {
362 362
                 continue;
363 363
             }
364 364
 
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
             $pivotPK = $model->getForeignKey();
440 440
             $pivotFK = $model->getQualifiedParentKeyName();
441 441
 
442
-            if (! in_array($pivot, $joins)) {
442
+            if (!in_array($pivot, $joins)) {
443 443
                 $this->getQueryBuilder()->leftJoin($pivot, $pivotPK, '=', $pivotFK);
444 444
             }
445 445
 
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
             $tablePK = $related->getForeignKey();
449 449
             $tableFK = $related->getQualifiedKeyName();
450 450
 
451
-            if (! in_array($table, $joins)) {
451
+            if (!in_array($table, $joins)) {
452 452
                 $this->getQueryBuilder()->leftJoin($table, $pivot . '.' . $tablePK, '=', $tableFK);
453 453
             }
454 454
         } else {
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
                 $other   = $model->getQualifiedOtherKeyName();
462 462
             }
463 463
 
464
-            if (! in_array($table, $joins)) {
464
+            if (!in_array($table, $joins)) {
465 465
                 $this->getQueryBuilder()->leftJoin($table, $foreign, '=', $other);
466 466
             }
467 467
         }
@@ -497,10 +497,10 @@  discard block
 block discarded – undo
497 497
     protected function regexColumnSearch($column, $keyword)
498 498
     {
499 499
         if ($this->isOracleSql()) {
500
-            $sql = ! $this->isCaseInsensitive() ? 'REGEXP_LIKE( ' . $column . ' , ? )' : 'REGEXP_LIKE( LOWER(' . $column . ') , ?, \'i\' )';
500
+            $sql = !$this->isCaseInsensitive() ? 'REGEXP_LIKE( ' . $column . ' , ? )' : 'REGEXP_LIKE( LOWER(' . $column . ') , ?, \'i\' )';
501 501
             $this->query->whereRaw($sql, [$keyword]);
502 502
         } else {
503
-            $sql = ! $this->isCaseInsensitive() ? $column . ' REGEXP ?' : 'LOWER(' . $column . ') REGEXP ?';
503
+            $sql = !$this->isCaseInsensitive() ? $column . ' REGEXP ?' : 'LOWER(' . $column . ') REGEXP ?';
504 504
             $this->query->whereRaw($sql, [Str::lower($keyword)]);
505 505
         }
506 506
     }
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 
546 546
                     if (in_array($relation, $eagerLoads)) {
547 547
                         $relationship = $this->query->getRelation($relation);
548
-                        if (! ($relationship instanceof MorphToMany)) {
548
+                        if (!($relationship instanceof MorphToMany)) {
549 549
                             $column = $this->joinEagerLoadedColumn($relation, $relationColumn);
550 550
                         } else {
551 551
                             $valid = 0;
Please login to merge, or discard this patch.