@@ -131,7 +131,7 @@ |
||
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 |
@@ -41,8 +41,8 @@ |
||
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); |
@@ -1,6 +1,6 @@ discard block |
||
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 |
||
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 | * |
@@ -53,13 +53,13 @@ |
||
53 | 53 | $myQuery = clone $this->query; |
54 | 54 | // if its a normal query ( no union, having and distinct word ) |
55 | 55 | // replace the select with static text to improve performance |
56 | - if (! Str::contains(Str::lower($myQuery->toSql()), ['union', 'having', 'distinct', 'order by', 'group by'])) { |
|
56 | + if (!Str::contains(Str::lower($myQuery->toSql()), ['union', 'having', 'distinct', 'order by', 'group by'])) { |
|
57 | 57 | $row_count = $this->wrap('row_count'); |
58 | 58 | $myQuery->select($this->connection->raw("'1' as {$row_count}")); |
59 | 59 | } |
60 | 60 | |
61 | 61 | // check for select soft deleted records |
62 | - if (! $this->withTrashed && ! $this->onlyTrashed && $this->modelUseSoftDeletes()) { |
|
62 | + if (!$this->withTrashed && !$this->onlyTrashed && $this->modelUseSoftDeletes()) { |
|
63 | 63 | $myQuery->whereNull($myQuery->getModel()->getQualifiedDeletedAtColumn()); |
64 | 64 | } |
65 | 65 |
@@ -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 | } |
@@ -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 |
@@ -237,7 +237,7 @@ |
||
237 | 237 | { |
238 | 238 | $arrayDot = array_filter(array_dot($row)); |
239 | 239 | foreach ($arrayDot as $key => $value) { |
240 | - if (! in_array($key, $this->rawColumns)) { |
|
240 | + if (!in_array($key, $this->rawColumns)) { |
|
241 | 241 | $arrayDot[$key] = e($value); |
242 | 242 | } |
243 | 243 | } |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | */ |
315 | 315 | public function getQueryBuilder($instance = null) |
316 | 316 | { |
317 | - if (! $instance) { |
|
317 | + if (!$instance) { |
|
318 | 318 | $instance = $this->query; |
319 | 319 | } |
320 | 320 | |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | $this->totalRecords = $this->totalCount(); |
509 | 509 | |
510 | 510 | if ($this->totalRecords) { |
511 | - $this->orderRecords(! $orderFirst); |
|
511 | + $this->orderRecords(!$orderFirst); |
|
512 | 512 | $this->filterRecords(); |
513 | 513 | $this->orderRecords($orderFirst); |
514 | 514 | $this->paginate(); |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | */ |
542 | 542 | protected function orderRecords($skip) |
543 | 543 | { |
544 | - if (! $skip) { |
|
544 | + if (!$skip) { |
|
545 | 545 | $this->ordering(); |
546 | 546 | } |
547 | 547 | } |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | */ |
573 | 573 | protected function paginate() |
574 | 574 | { |
575 | - if ($this->request->isPaginationable() && ! $this->skipPaging) { |
|
575 | + if ($this->request->isPaginationable() && !$this->skipPaging) { |
|
576 | 576 | $this->paging(); |
577 | 577 | } |
578 | 578 | } |
@@ -872,7 +872,7 @@ discard block |
||
872 | 872 | */ |
873 | 873 | public function pushToBlacklist($column) |
874 | 874 | { |
875 | - if (! $this->isBlacklisted($column)) { |
|
875 | + if (!$this->isBlacklisted($column)) { |
|
876 | 876 | array_push($this->columnDef['blacklist'], $column); |
877 | 877 | } |
878 | 878 | |
@@ -1051,7 +1051,7 @@ discard block |
||
1051 | 1051 | { |
1052 | 1052 | $matches = explode(' as ', Str::lower($str)); |
1053 | 1053 | |
1054 | - if (! empty($matches)) { |
|
1054 | + if (!empty($matches)) { |
|
1055 | 1055 | if ($wantsAlias) { |
1056 | 1056 | return array_pop($matches); |
1057 | 1057 | } else { |
@@ -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 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | |
166 | 166 | foreach ($this->request->searchableColumnIndex() as $index) { |
167 | 167 | $columnName = $this->getColumnName($index); |
168 | - if ($this->isBlacklisted($columnName) && ! $this->hasCustomFilter($columnName)) { |
|
168 | + if ($this->isBlacklisted($columnName) && !$this->hasCustomFilter($columnName)) { |
|
169 | 169 | continue; |
170 | 170 | } |
171 | 171 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $columnDef = $this->columnDef['filter'][$columnName]; |
175 | 175 | // check if global search should be applied for the specific column |
176 | 176 | $applyGlobalSearch = count($columnDef['parameters']) == 0 || end($columnDef['parameters']) !== false; |
177 | - if (! $applyGlobalSearch) { |
|
177 | + if (!$applyGlobalSearch) { |
|
178 | 178 | continue; |
179 | 179 | } |
180 | 180 | |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | $q = $query; |
428 | 428 | } |
429 | 429 | |
430 | - if (! $q->from instanceof Expression) { |
|
430 | + if (!$q->from instanceof Expression) { |
|
431 | 431 | // Get table from query and add it. |
432 | 432 | $column = $q->from . '.' . $column; |
433 | 433 | } |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | $columns = $this->request->columns(); |
487 | 487 | |
488 | 488 | foreach ($columns as $index => $column) { |
489 | - if (! $this->request->isColumnSearchable($index)) { |
|
489 | + if (!$this->request->isColumnSearchable($index)) { |
|
490 | 490 | continue; |
491 | 491 | } |
492 | 492 | |
@@ -620,7 +620,7 @@ discard block |
||
620 | 620 | $joins[] = $join->table; |
621 | 621 | } |
622 | 622 | |
623 | - if (! in_array($table, $joins)) { |
|
623 | + if (!in_array($table, $joins)) { |
|
624 | 624 | $this->getQueryBuilder()->leftJoin($table, $foreign, '=', $other); |
625 | 625 | } |
626 | 626 | } |
@@ -651,13 +651,13 @@ discard block |
||
651 | 651 | protected function regexColumnSearch($column, $keyword) |
652 | 652 | { |
653 | 653 | if ($this->isOracleSql()) { |
654 | - $sql = ! $this->isCaseInsensitive() ? 'REGEXP_LIKE( ' . $column . ' , ? )' : 'REGEXP_LIKE( LOWER(' . $column . ') , ?, \'i\' )'; |
|
654 | + $sql = !$this->isCaseInsensitive() ? 'REGEXP_LIKE( ' . $column . ' , ? )' : 'REGEXP_LIKE( LOWER(' . $column . ') , ?, \'i\' )'; |
|
655 | 655 | $this->query->whereRaw($sql, [$keyword]); |
656 | 656 | } elseif ($this->database == 'pgsql') { |
657 | - $sql = ! $this->isCaseInsensitive() ? $column . ' ~ ?' : $column . ' ~* ? '; |
|
657 | + $sql = !$this->isCaseInsensitive() ? $column . ' ~ ?' : $column . ' ~* ? '; |
|
658 | 658 | $this->query->whereRaw($sql, [$keyword]); |
659 | 659 | } else { |
660 | - $sql = ! $this->isCaseInsensitive() ? $column . ' REGEXP ?' : 'LOWER(' . $column . ') REGEXP ?'; |
|
660 | + $sql = !$this->isCaseInsensitive() ? $column . ' REGEXP ?' : 'LOWER(' . $column . ') REGEXP ?'; |
|
661 | 661 | $this->query->whereRaw($sql, [Str::lower($keyword)]); |
662 | 662 | } |
663 | 663 | } |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | foreach ($this->request->orderableColumns() as $orderable) { |
679 | 679 | $column = $this->getColumnName($orderable['column'], true); |
680 | 680 | |
681 | - if ($this->isBlacklisted($column) && ! $this->hasCustomOrder($column)) { |
|
681 | + if ($this->isBlacklisted($column) && !$this->hasCustomOrder($column)) { |
|
682 | 682 | continue; |
683 | 683 | } |
684 | 684 | |
@@ -709,7 +709,7 @@ discard block |
||
709 | 709 | $isMorphToMany = false; |
710 | 710 | foreach (explode('.', $relation) as $eachRelation) { |
711 | 711 | $relationship = $lastQuery->getRelation($eachRelation); |
712 | - if (! ($relationship instanceof MorphToMany)) { |
|
712 | + if (!($relationship instanceof MorphToMany)) { |
|
713 | 713 | $isMorphToMany = true; |
714 | 714 | } |
715 | 715 | $lastQuery = $relationship; |