Completed
Push — master ( b2b7ae...6094fe )
by Arjay
08:43 queued 06:45
created
src/Engines/QueryBuilderEngine.php 1 patch
Spacing   +11 added lines, -11 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
 
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
      */
272 272
     protected function compileRelationSearch($query, $relation, $column, $keyword)
273 273
     {
274
-        $myQuery      = clone $this->query;
274
+        $myQuery = clone $this->query;
275 275
 
276 276
         /**
277 277
          * For compile nested relation, we need store all nested relation as array
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
         $columns = $this->request->get('columns', []);
437 437
 
438 438
         foreach ($columns as $index => $column) {
439
-            if (! $this->request->isColumnSearchable($index)) {
439
+            if (!$this->request->isColumnSearchable($index)) {
440 440
                 continue;
441 441
             }
442 442
 
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
             $pivotPK = $model->getForeignKey();
518 518
             $pivotFK = $model->getQualifiedParentKeyName();
519 519
 
520
-            if (! in_array($pivot, $joins)) {
520
+            if (!in_array($pivot, $joins)) {
521 521
                 $this->getQueryBuilder()->leftJoin($pivot, $pivotPK, '=', $pivotFK);
522 522
             }
523 523
 
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
             $tablePK = $related->getForeignKey();
527 527
             $tableFK = $related->getQualifiedKeyName();
528 528
 
529
-            if (! in_array($table, $joins)) {
529
+            if (!in_array($table, $joins)) {
530 530
                 $this->getQueryBuilder()->leftJoin($table, $pivot . '.' . $tablePK, '=', $tableFK);
531 531
             }
532 532
         } else {
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
                 $other   = $model->getQualifiedOtherKeyName();
540 540
             }
541 541
 
542
-            if (! in_array($table, $joins)) {
542
+            if (!in_array($table, $joins)) {
543 543
                 $this->getQueryBuilder()->leftJoin($table, $foreign, '=', $other);
544 544
             }
545 545
         }
@@ -575,10 +575,10 @@  discard block
 block discarded – undo
575 575
     protected function regexColumnSearch($column, $keyword)
576 576
     {
577 577
         if ($this->isOracleSql()) {
578
-            $sql = ! $this->isCaseInsensitive() ? 'REGEXP_LIKE( ' . $column . ' , ? )' : 'REGEXP_LIKE( LOWER(' . $column . ') , ?, \'i\' )';
578
+            $sql = !$this->isCaseInsensitive() ? 'REGEXP_LIKE( ' . $column . ' , ? )' : 'REGEXP_LIKE( LOWER(' . $column . ') , ?, \'i\' )';
579 579
             $this->query->whereRaw($sql, [$keyword]);
580 580
         } else {
581
-            $sql = ! $this->isCaseInsensitive() ? $column . ' REGEXP ?' : 'LOWER(' . $column . ') REGEXP ?';
581
+            $sql = !$this->isCaseInsensitive() ? $column . ' REGEXP ?' : 'LOWER(' . $column . ') REGEXP ?';
582 582
             $this->query->whereRaw($sql, [Str::lower($keyword)]);
583 583
         }
584 584
     }
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
 
624 624
                     if (in_array($relation, $eagerLoads)) {
625 625
                         $relationship = $this->query->getRelation($relation);
626
-                        if (! ($relationship instanceof MorphToMany)) {
626
+                        if (!($relationship instanceof MorphToMany)) {
627 627
                             $column = $this->joinEagerLoadedColumn($relation, $relationColumn);
628 628
                         } else {
629 629
                             $valid = 0;
Please login to merge, or discard this patch.