Completed
Push — master ( 6094fe...269f87 )
by Arjay
08:09
created
src/Helper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@
 block discarded – undo
131 131
      */
132 132
     public static function getOrMethod($method)
133 133
     {
134
-        if (! Str::contains(Str::lower($method), 'or')) {
134
+        if (!Str::contains(Str::lower($method), 'or')) {
135 135
             return 'or' . ucfirst($method);
136 136
         }
137 137
 
Please login to merge, or discard this patch.
src/Processors/RowProcessor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,8 @@
 block discarded – undo
41 41
      */
42 42
     public function rowValue($attribute, $template)
43 43
     {
44
-        if (! empty($template)) {
45
-            if (! is_callable($template) && Arr::get($this->data, $template)) {
44
+        if (!empty($template)) {
45
+            if (!is_callable($template) && Arr::get($this->data, $template)) {
46 46
                 $this->data[$attribute] = Arr::get($this->data, $template);
47 47
             } else {
48 48
                 $this->data[$attribute] = Helper::compileContent($template, $this->data, $this->row);
Please login to merge, or discard this patch.
src/fallback.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (! function_exists('config_path')) {
3
+if (!function_exists('config_path')) {
4 4
     /**
5 5
      * Get the configuration path.
6 6
      *
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     }
14 14
 }
15 15
 
16
-if (! function_exists('public_path')) {
16
+if (!function_exists('public_path')) {
17 17
     /**
18 18
      * Return the path to public dir
19 19
      *
Please login to merge, or discard this patch.
src/Engines/QueryBuilderEngine.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -309,7 +309,7 @@
 block discarded – undo
309 309
      * Perform case insensitive column search.
310 310
      *
311 311
      * @param int $i
312
-     * @param mixed $column
312
+     * @param string $column
313 313
      * @param string $keyword
314 314
      */
315 315
     protected function caseInsensitiveColumnSearch($i, $column, $keyword)
Please login to merge, or discard this 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.
src/Engines/BaseEngine.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -770,7 +770,7 @@
 block discarded – undo
770 770
      * Get column name by order column index.
771 771
      *
772 772
      * @param int $index
773
-     * @return mixed
773
+     * @return boolean|string
774 774
      */
775 775
     protected function getColumnNameByIndex($index)
776 776
     {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
      */
316 316
     public function getQueryBuilder($instance = null)
317 317
     {
318
-        if (! $instance) {
318
+        if (!$instance) {
319 319
             $instance = $this->query;
320 320
         }
321 321
 
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
         $this->totalRecords = $this->totalCount();
508 508
 
509 509
         if ($this->totalRecords) {
510
-            $this->orderRecords(! $orderFirst);
510
+            $this->orderRecords(!$orderFirst);
511 511
             $this->filterRecords();
512 512
             $this->orderRecords($orderFirst);
513 513
             $this->paginate();
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
      */
525 525
     protected function orderRecords($skip)
526 526
     {
527
-        if (! $skip) {
527
+        if (!$skip) {
528 528
             $this->ordering();
529 529
         }
530 530
     }
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
      */
556 556
     protected function paginate()
557 557
     {
558
-        if ($this->request->isPaginationable() && ! $this->skipPaging) {
558
+        if ($this->request->isPaginationable() && !$this->skipPaging) {
559 559
             $this->paging();
560 560
         }
561 561
     }
@@ -979,7 +979,7 @@  discard block
 block discarded – undo
979 979
     {
980 980
         $matches = explode(' as ', Str::lower($str));
981 981
 
982
-        if (! empty($matches)) {
982
+        if (!empty($matches)) {
983 983
             if ($wantsAlias) {
984 984
                 return array_pop($matches);
985 985
             } else {
Please login to merge, or discard this patch.
src/Html/Builder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
      */
348 348
     public function getTableAttribute($attribute)
349 349
     {
350
-        if (! array_key_exists($attribute, $this->tableAttributes)) {
350
+        if (!array_key_exists($attribute, $this->tableAttributes)) {
351 351
             throw new \Exception("Table attribute '{$attribute}' does not exist.");
352 352
         }
353 353
 
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
     public function columns(array $columns)
390 390
     {
391 391
         foreach ($columns as $key => $value) {
392
-            if (! is_a($value, Column::class)) {
392
+            if (!is_a($value, Column::class)) {
393 393
                 if (is_array($value)) {
394 394
                     $attributes = array_merge(['name' => $key, 'data' => $key], $this->setTitle($key, $value));
395 395
                 } else {
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
      */
419 419
     public function setTitle($title, array $attributes)
420 420
     {
421
-        if (! isset($attributes['title'])) {
421
+        if (!isset($attributes['title'])) {
422 422
             $attributes['title'] = $this->getQualifiedTitle($title);
423 423
         }
424 424
 
Please login to merge, or discard this patch.
src/Engines/CollectionEngine.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
                 $keyword = $this->request->keyword();
151 151
                 foreach ($this->request->searchableColumnIndex() as $index) {
152 152
                     $column = $this->getColumnName($index);
153
-                    if (! $value = Arr::get($data, $column)) {
153
+                    if (!$value = Arr::get($data, $column)) {
154 154
                         continue;
155 155
                     }
156 156
 
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
     {
208 208
         $this->collection = $this->collection->slice(
209 209
             $this->request['start'],
210
-            (int)$this->request['length'] > 0 ? $this->request['length'] : 10
210
+            (int) $this->request['length'] > 0 ? $this->request['length'] : 10
211 211
         );
212 212
     }
213 213
 
Please login to merge, or discard this patch.
src/Request.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
      * Check if Datatables must uses regular expressions
42 42
      *
43 43
      * @param integer $index
44
-     * @return string
44
+     * @return boolean
45 45
      */
46 46
     public function isRegex($index)
47 47
     {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
      */
21 21
     public function checkLegacyCode()
22 22
     {
23
-        if (! $this->input('draw') && $this->input('sEcho')) {
23
+        if (!$this->input('draw') && $this->input('sEcho')) {
24 24
             throw new Exception('DataTables legacy code is not supported! Please use DataTables 1.10++ coding convention.');
25
-        } elseif (! $this->input('draw') && ! $this->input('columns')) {
25
+        } elseif (!$this->input('draw') && !$this->input('columns')) {
26 26
             throw new Exception('Insufficient parameters');
27 27
         }
28 28
     }
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function orderableColumns()
57 57
     {
58
-        if (! $this->isOrderable()) {
58
+        if (!$this->isOrderable()) {
59 59
             return [];
60 60
         }
61 61
 
@@ -167,6 +167,6 @@  discard block
 block discarded – undo
167 167
      */
168 168
     public function isPaginationable()
169 169
     {
170
-        return ! is_null($this->input('start')) && ! is_null($this->input('length')) && $this->input('length') != -1;
170
+        return !is_null($this->input('start')) && !is_null($this->input('length')) && $this->input('length') != -1;
171 171
     }
172 172
 }
Please login to merge, or discard this patch.