@@ -123,7 +123,7 @@ |
||
| 123 | 123 | $keyword = $this->request->keyword(); |
| 124 | 124 | foreach ($this->request->searchableColumnIndex() as $index) { |
| 125 | 125 | $column = $this->getColumnName($index); |
| 126 | - if (! $value = Arr::get($data, $column)) { |
|
| 126 | + if (!$value = Arr::get($data, $column)) { |
|
| 127 | 127 | continue; |
| 128 | 128 | } |
| 129 | 129 | |
@@ -41,7 +41,7 @@ |
||
| 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 | { |
@@ -75,9 +75,9 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function checkLegacyCode() |
| 77 | 77 | { |
| 78 | - if (! $this->request->input('draw') && $this->request->input('sEcho')) { |
|
| 78 | + if (!$this->request->input('draw') && $this->request->input('sEcho')) { |
|
| 79 | 79 | throw new Exception('DataTables legacy code is not supported! Please use DataTables 1.10++ coding convention.'); |
| 80 | - } elseif (! $this->request->input('draw') && ! $this->request->input('columns')) { |
|
| 80 | + } elseif (!$this->request->input('draw') && !$this->request->input('columns')) { |
|
| 81 | 81 | throw new Exception('Insufficient parameters'); |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | public function orderableColumns() |
| 112 | 112 | { |
| 113 | - if (! $this->isOrderable()) { |
|
| 113 | + if (!$this->isOrderable()) { |
|
| 114 | 114 | return []; |
| 115 | 115 | } |
| 116 | 116 | |
@@ -221,6 +221,6 @@ discard block |
||
| 221 | 221 | */ |
| 222 | 222 | public function isPaginationable() |
| 223 | 223 | { |
| 224 | - return ! is_null($this->request->input('start')) && ! is_null($this->request->input('length')) && $this->request->input('length') != -1; |
|
| 224 | + return !is_null($this->request->input('start')) && !is_null($this->request->input('length')) && $this->request->input('length') != -1; |
|
| 225 | 225 | } |
| 226 | 226 | } |
@@ -580,7 +580,7 @@ |
||
| 580 | 580 | * Compile queries for column search. |
| 581 | 581 | * |
| 582 | 582 | * @param int $i |
| 583 | - * @param mixed $column |
|
| 583 | + * @param string $column |
|
| 584 | 584 | * @param string $keyword |
| 585 | 585 | */ |
| 586 | 586 | protected function compileColumnSearch($i, $column, $keyword) |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $myQuery = clone $this->query; |
| 100 | 100 | // if its a normal query ( no union, having and distinct word ) |
| 101 | 101 | // replace the select with static text to improve performance |
| 102 | - if (! Str::contains(Str::lower($myQuery->toSql()), ['union', 'having', 'distinct', 'order by', 'group by'])) { |
|
| 102 | + if (!Str::contains(Str::lower($myQuery->toSql()), ['union', 'having', 'distinct', 'order by', 'group by'])) { |
|
| 103 | 103 | $row_count = $this->wrap('row_count'); |
| 104 | 104 | $myQuery->select($this->connection->raw("'1' as {$row_count}")); |
| 105 | 105 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $columnDef = $this->columnDef['filter'][$columnName]; |
| 143 | 143 | // check if global search should be applied for the specific column |
| 144 | 144 | $applyGlobalSearch = count($columnDef['parameters']) == 0 || end($columnDef['parameters']) !== false; |
| 145 | - if (! $applyGlobalSearch) { |
|
| 145 | + if (!$applyGlobalSearch) { |
|
| 146 | 146 | continue; |
| 147 | 147 | } |
| 148 | 148 | |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | $q = $query; |
| 389 | 389 | } |
| 390 | 390 | |
| 391 | - if (! $q->from instanceof Expression) { |
|
| 391 | + if (!$q->from instanceof Expression) { |
|
| 392 | 392 | // Get table from query and add it. |
| 393 | 393 | $column = $q->from . '.' . $column; |
| 394 | 394 | } |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | $columns = $this->request->columns(); |
| 448 | 448 | |
| 449 | 449 | foreach ($columns as $index => $column) { |
| 450 | - if (! $this->request->isColumnSearchable($index)) { |
|
| 450 | + if (!$this->request->isColumnSearchable($index)) { |
|
| 451 | 451 | continue; |
| 452 | 452 | } |
| 453 | 453 | |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | $joins[] = $join->table; |
| 572 | 572 | } |
| 573 | 573 | |
| 574 | - if (! in_array($table, $joins)) { |
|
| 574 | + if (!in_array($table, $joins)) { |
|
| 575 | 575 | $this->getQueryBuilder()->leftJoin($table, $foreign, '=', $other); |
| 576 | 576 | } |
| 577 | 577 | } |
@@ -602,13 +602,13 @@ discard block |
||
| 602 | 602 | protected function regexColumnSearch($column, $keyword) |
| 603 | 603 | { |
| 604 | 604 | if ($this->isOracleSql()) { |
| 605 | - $sql = ! $this->isCaseInsensitive() ? 'REGEXP_LIKE( ' . $column . ' , ? )' : 'REGEXP_LIKE( LOWER(' . $column . ') , ?, \'i\' )'; |
|
| 605 | + $sql = !$this->isCaseInsensitive() ? 'REGEXP_LIKE( ' . $column . ' , ? )' : 'REGEXP_LIKE( LOWER(' . $column . ') , ?, \'i\' )'; |
|
| 606 | 606 | $this->query->whereRaw($sql, [$keyword]); |
| 607 | 607 | } elseif ($this->database == 'pgsql') { |
| 608 | - $sql = ! $this->isCaseInsensitive() ? $column . ' ~ ?' : $column . ' ~* ? '; |
|
| 608 | + $sql = !$this->isCaseInsensitive() ? $column . ' ~ ?' : $column . ' ~* ? '; |
|
| 609 | 609 | $this->query->whereRaw($sql, [$keyword]); |
| 610 | 610 | } else { |
| 611 | - $sql = ! $this->isCaseInsensitive() ? $column . ' REGEXP ?' : 'LOWER(' . $column . ') REGEXP ?'; |
|
| 611 | + $sql = !$this->isCaseInsensitive() ? $column . ' REGEXP ?' : 'LOWER(' . $column . ') REGEXP ?'; |
|
| 612 | 612 | $this->query->whereRaw($sql, [Str::lower($keyword)]); |
| 613 | 613 | } |
| 614 | 614 | } |
@@ -653,7 +653,7 @@ discard block |
||
| 653 | 653 | |
| 654 | 654 | if (in_array($relation, $eagerLoads)) { |
| 655 | 655 | $relationship = $this->query->getRelation($relation); |
| 656 | - if (! ($relationship instanceof MorphToMany)) { |
|
| 656 | + if (!($relationship instanceof MorphToMany)) { |
|
| 657 | 657 | $column = $this->joinEagerLoadedColumn($relation, $relationColumn); |
| 658 | 658 | } else { |
| 659 | 659 | $valid = 0; |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | */ |
| 308 | 308 | public function getQueryBuilder($instance = null) |
| 309 | 309 | { |
| 310 | - if (! $instance) { |
|
| 310 | + if (!$instance) { |
|
| 311 | 311 | $instance = $this->query; |
| 312 | 312 | } |
| 313 | 313 | |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | $this->totalRecords = $this->totalCount(); |
| 500 | 500 | |
| 501 | 501 | if ($this->totalRecords) { |
| 502 | - $this->orderRecords(! $orderFirst); |
|
| 502 | + $this->orderRecords(!$orderFirst); |
|
| 503 | 503 | $this->filterRecords(); |
| 504 | 504 | $this->orderRecords($orderFirst); |
| 505 | 505 | $this->paginate(); |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | */ |
| 517 | 517 | protected function orderRecords($skip) |
| 518 | 518 | { |
| 519 | - if (! $skip) { |
|
| 519 | + if (!$skip) { |
|
| 520 | 520 | $this->ordering(); |
| 521 | 521 | } |
| 522 | 522 | } |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | */ |
| 548 | 548 | protected function paginate() |
| 549 | 549 | { |
| 550 | - if ($this->request->isPaginationable() && ! $this->skipPaging) { |
|
| 550 | + if ($this->request->isPaginationable() && !$this->skipPaging) { |
|
| 551 | 551 | $this->paging(); |
| 552 | 552 | } |
| 553 | 553 | } |
@@ -655,7 +655,7 @@ discard block |
||
| 655 | 655 | */ |
| 656 | 656 | public function isDebugging() |
| 657 | 657 | { |
| 658 | - return !! config('app.debug', false); |
|
| 658 | + return !!config('app.debug', false); |
|
| 659 | 659 | } |
| 660 | 660 | |
| 661 | 661 | /** |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | */ |
| 680 | 680 | public function isCaseInsensitive() |
| 681 | 681 | { |
| 682 | - return !! config('datatables.search.case_insensitive', false); |
|
| 682 | + return !!config('datatables.search.case_insensitive', false); |
|
| 683 | 683 | } |
| 684 | 684 | |
| 685 | 685 | /** |
@@ -830,7 +830,7 @@ discard block |
||
| 830 | 830 | */ |
| 831 | 831 | public function isSmartSearch() |
| 832 | 832 | { |
| 833 | - return !! config('datatables.search.smart', true); |
|
| 833 | + return !!config('datatables.search.smart', true); |
|
| 834 | 834 | } |
| 835 | 835 | |
| 836 | 836 | /** |
@@ -840,7 +840,7 @@ discard block |
||
| 840 | 840 | */ |
| 841 | 841 | public function isWildcard() |
| 842 | 842 | { |
| 843 | - return !! config('datatables.search.use_wildcards', false); |
|
| 843 | + return !!config('datatables.search.use_wildcards', false); |
|
| 844 | 844 | } |
| 845 | 845 | |
| 846 | 846 | /** |
@@ -973,7 +973,7 @@ discard block |
||
| 973 | 973 | { |
| 974 | 974 | $matches = explode(' as ', Str::lower($str)); |
| 975 | 975 | |
| 976 | - if (! empty($matches)) { |
|
| 976 | + if (!empty($matches)) { |
|
| 977 | 977 | if ($wantsAlias) { |
| 978 | 978 | return array_pop($matches); |
| 979 | 979 | } else { |
@@ -112,7 +112,7 @@ |
||
| 112 | 112 | */ |
| 113 | 113 | public function getHtmlBuilder() |
| 114 | 114 | { |
| 115 | - if (! class_exists('\Yajra\Datatables\Html\Builder')) { |
|
| 115 | + if (!class_exists('\Yajra\Datatables\Html\Builder')) { |
|
| 116 | 116 | throw new \Exception('Please install yajra/laravel-datatables-html to be able to use this function.'); |
| 117 | 117 | } |
| 118 | 118 | |