@@ -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 | * |
@@ -309,7 +309,7 @@ |
||
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) |
@@ -98,13 +98,13 @@ discard block |
||
98 | 98 | $myQuery = clone $this->query; |
99 | 99 | // if its a normal query ( no union, having and distinct word ) |
100 | 100 | // replace the select with static text to improve performance |
101 | - if (! Str::contains(Str::lower($myQuery->toSql()), ['union', 'having', 'distinct', 'order by', 'group by'])) { |
|
101 | + if (!Str::contains(Str::lower($myQuery->toSql()), ['union', 'having', 'distinct', 'order by', 'group by'])) { |
|
102 | 102 | $row_count = $this->wrap('row_count'); |
103 | 103 | $myQuery->select($this->connection->raw("'1' as {$row_count}")); |
104 | 104 | } |
105 | 105 | |
106 | 106 | // check for select soft deleted records |
107 | - if (! $this->withTrashed && $this->modelUseSoftDeletes()) { |
|
107 | + if (!$this->withTrashed && $this->modelUseSoftDeletes()) { |
|
108 | 108 | $myQuery->whereNull($myQuery->getModel()->getQualifiedDeletedAtColumn()); |
109 | 109 | } |
110 | 110 | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $columnDef = $this->columnDef['filter'][$columnName]; |
161 | 161 | // check if global search should be applied for the specific column |
162 | 162 | $applyGlobalSearch = count($columnDef['parameters']) == 0 || end($columnDef['parameters']) !== false; |
163 | - if (! $applyGlobalSearch) { |
|
163 | + if (!$applyGlobalSearch) { |
|
164 | 164 | continue; |
165 | 165 | } |
166 | 166 | |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | $q = $query; |
407 | 407 | } |
408 | 408 | |
409 | - if (! $q->from instanceof Expression) { |
|
409 | + if (!$q->from instanceof Expression) { |
|
410 | 410 | // Get table from query and add it. |
411 | 411 | $column = $q->from . '.' . $column; |
412 | 412 | } |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | $columns = (array) $this->request->input('columns'); |
466 | 466 | |
467 | 467 | foreach ($columns as $index => $column) { |
468 | - if (! $this->request->isColumnSearchable($index)) { |
|
468 | + if (!$this->request->isColumnSearchable($index)) { |
|
469 | 469 | continue; |
470 | 470 | } |
471 | 471 | |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | $joins[] = $join->table; |
582 | 582 | } |
583 | 583 | |
584 | - if (! in_array($table, $joins)) { |
|
584 | + if (!in_array($table, $joins)) { |
|
585 | 585 | $this->getQueryBuilder()->join($table, $foreign, '=', $other); |
586 | 586 | } |
587 | 587 | } |
@@ -612,10 +612,10 @@ discard block |
||
612 | 612 | protected function regexColumnSearch($column, $keyword) |
613 | 613 | { |
614 | 614 | if ($this->isOracleSql()) { |
615 | - $sql = ! $this->isCaseInsensitive() ? 'REGEXP_LIKE( ' . $column . ' , ? )' : 'REGEXP_LIKE( LOWER(' . $column . ') , ?, \'i\' )'; |
|
615 | + $sql = !$this->isCaseInsensitive() ? 'REGEXP_LIKE( ' . $column . ' , ? )' : 'REGEXP_LIKE( LOWER(' . $column . ') , ?, \'i\' )'; |
|
616 | 616 | $this->query->whereRaw($sql, [$keyword]); |
617 | 617 | } else { |
618 | - $sql = ! $this->isCaseInsensitive() ? $column . ' REGEXP ?' : 'LOWER(' . $column . ') REGEXP ?'; |
|
618 | + $sql = !$this->isCaseInsensitive() ? $column . ' REGEXP ?' : 'LOWER(' . $column . ') REGEXP ?'; |
|
619 | 619 | $this->query->whereRaw($sql, [Str::lower($keyword)]); |
620 | 620 | } |
621 | 621 | } |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | |
661 | 661 | if (in_array($relation, $eagerLoads)) { |
662 | 662 | $relationship = $this->query->getRelation($relation); |
663 | - if (! ($relationship instanceof MorphToMany)) { |
|
663 | + if (!($relationship instanceof MorphToMany)) { |
|
664 | 664 | $column = $this->joinEagerLoadedColumn($relation, $relationColumn); |
665 | 665 | } else { |
666 | 666 | $valid = 0; |
@@ -770,7 +770,7 @@ |
||
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 | { |
@@ -315,7 +315,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -860,7 +860,7 @@ discard block |
||
860 | 860 | */ |
861 | 861 | protected function wildcardLikeString($str, $lowercase = true) |
862 | 862 | { |
863 | - $wild = '%'; |
|
863 | + $wild = '%'; |
|
864 | 864 | $chars = preg_split('//u', $str, -1, PREG_SPLIT_NO_EMPTY); |
865 | 865 | |
866 | 866 | if (count($chars) > 0) { |
@@ -981,7 +981,7 @@ discard block |
||
981 | 981 | { |
982 | 982 | $matches = explode(' as ', Str::lower($str)); |
983 | 983 | |
984 | - if (! empty($matches)) { |
|
984 | + if (!empty($matches)) { |
|
985 | 985 | if ($wantsAlias) { |
986 | 986 | return array_pop($matches); |
987 | 987 | } else { |
@@ -150,7 +150,7 @@ discard block |
||
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 |
||
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 |
@@ -20,9 +20,9 @@ discard block |
||
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 |
||
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 |
||
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 | } |