@@ -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 |
@@ -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); |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | */ |
18 | 18 | public function checkLegacyCode() |
19 | 19 | { |
20 | - if (! $this->get('draw') && $this->get('sEcho')) { |
|
20 | + if (!$this->get('draw') && $this->get('sEcho')) { |
|
21 | 21 | throw new Exception('DataTables legacy code is not supported! Please use DataTables 1.10++ coding convention.'); |
22 | - } elseif (! $this->get('draw') && ! $this->get('columns')) { |
|
22 | + } elseif (!$this->get('draw') && !$this->get('columns')) { |
|
23 | 23 | throw new Exception('Insufficient parameters'); |
24 | 24 | } |
25 | 25 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function orderableColumns() |
65 | 65 | { |
66 | - if (! $this->isOrderable()) { |
|
66 | + if (!$this->isOrderable()) { |
|
67 | 67 | return []; |
68 | 68 | } |
69 | 69 | |
@@ -162,6 +162,6 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public function isPaginationable() |
164 | 164 | { |
165 | - return ! is_null($this->get('start')) && ! is_null($this->get('length')) && $this->get('length') != -1; |
|
165 | + return !is_null($this->get('start')) && !is_null($this->get('length')) && $this->get('length') != -1; |
|
166 | 166 | } |
167 | 167 | } |
@@ -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) |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $myQuery = clone $this->query; |
95 | 95 | // if its a normal query ( no union, having and distinct word ) |
96 | 96 | // replace the select with static text to improve performance |
97 | - if (! Str::contains(Str::lower($myQuery->toSql()), ['union', 'having', 'distinct', 'order by', 'group by'])) { |
|
97 | + if (!Str::contains(Str::lower($myQuery->toSql()), ['union', 'having', 'distinct', 'order by', 'group by'])) { |
|
98 | 98 | $row_count = $this->wrap('row_count'); |
99 | 99 | $myQuery->select($this->connection->raw("'1' as {$row_count}")); |
100 | 100 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $columnDef = $this->columnDef['filter'][$columnName]; |
137 | 137 | // check if global search should be applied for the specific column |
138 | 138 | $applyGlobalSearch = count($columnDef['parameters']) == 0 || end($columnDef['parameters']) !== false; |
139 | - if (! $applyGlobalSearch) { |
|
139 | + if (!$applyGlobalSearch) { |
|
140 | 140 | continue; |
141 | 141 | } |
142 | 142 | |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | $keyword = "%$keyword%"; |
287 | 287 | } |
288 | 288 | |
289 | - $query->{$relation .'WhereRaw'}($sql, [$keyword]); |
|
289 | + $query->{$relation . 'WhereRaw'}($sql, [$keyword]); |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | /** |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | $columns = $this->request->get('columns', []); |
318 | 318 | |
319 | 319 | foreach ($columns as $index => $column) { |
320 | - if (! $this->request->isColumnSearchable($index)) { |
|
320 | + if (!$this->request->isColumnSearchable($index)) { |
|
321 | 321 | continue; |
322 | 322 | } |
323 | 323 | |
@@ -404,10 +404,10 @@ discard block |
||
404 | 404 | protected function regexColumnSearch($column, $keyword) |
405 | 405 | { |
406 | 406 | if ($this->isOracleSql()) { |
407 | - $sql = ! $this->isCaseInsensitive() ? 'REGEXP_LIKE( ' . $column . ' , ? )' : 'REGEXP_LIKE( LOWER(' . $column . ') , ?, \'i\' )'; |
|
407 | + $sql = !$this->isCaseInsensitive() ? 'REGEXP_LIKE( ' . $column . ' , ? )' : 'REGEXP_LIKE( LOWER(' . $column . ') , ?, \'i\' )'; |
|
408 | 408 | $this->query->whereRaw($sql, [$keyword]); |
409 | 409 | } else { |
410 | - $sql = ! $this->isCaseInsensitive() ? $column . ' REGEXP ?' : 'LOWER(' . $column . ') REGEXP ?'; |
|
410 | + $sql = !$this->isCaseInsensitive() ? $column . ' REGEXP ?' : 'LOWER(' . $column . ') REGEXP ?'; |
|
411 | 411 | $this->query->whereRaw($sql, [Str::lower($keyword)]); |
412 | 412 | } |
413 | 413 | } |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | $pivotPK = $model->getForeignKey(); |
480 | 480 | $pivotFK = $model->getQualifiedParentKeyName(); |
481 | 481 | |
482 | - if (! in_array($pivot, $joins)) { |
|
482 | + if (!in_array($pivot, $joins)) { |
|
483 | 483 | $this->getQueryBuilder()->leftJoin($pivot, $pivotPK, '=', $pivotFK); |
484 | 484 | } |
485 | 485 | |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | $tablePK = $related->getForeignKey(); |
489 | 489 | $tableFK = $related->getQualifiedKeyName(); |
490 | 490 | |
491 | - if (! in_array($table, $joins)) { |
|
491 | + if (!in_array($table, $joins)) { |
|
492 | 492 | $this->getQueryBuilder()->leftJoin($table, $pivot . '.' . $tablePK, '=', $tableFK); |
493 | 493 | } |
494 | 494 | } else { |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | $other = $model->getQualifiedOtherKeyName(); |
502 | 502 | } |
503 | 503 | |
504 | - if (! in_array($table, $joins)) { |
|
504 | + if (!in_array($table, $joins)) { |
|
505 | 505 | $this->getQueryBuilder()->leftJoin($table, $foreign, '=', $other); |
506 | 506 | } |
507 | 507 | } |
@@ -115,7 +115,7 @@ |
||
115 | 115 | protected function editColumns($data, $row) |
116 | 116 | { |
117 | 117 | foreach ($this->editColumns as $key => $value) { |
118 | - $value['content'] = Helper::compileContent($value['content'], $data, $row); |
|
118 | + $value['content'] = Helper::compileContent($value['content'], $data, $row); |
|
119 | 119 | Arr::set($data, $value['name'], $value['content']); |
120 | 120 | } |
121 | 121 |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | foreach ($joins as $join) { |
269 | 269 | $table = preg_split('/ as /i', $join->table); |
270 | 270 | $names[] = $table[0]; |
271 | - if (isset($table[1]) && ! empty($databasePrefix) && strpos($table[1], $databasePrefix) == 0) { |
|
271 | + if (isset($table[1]) && !empty($databasePrefix) && strpos($table[1], $databasePrefix) == 0) { |
|
272 | 272 | $names[] = preg_replace('/^' . $databasePrefix . '/', '', $table[1]); |
273 | 273 | } |
274 | 274 | } |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | */ |
285 | 285 | public function getQueryBuilder($instance = null) |
286 | 286 | { |
287 | - if (! $instance) { |
|
287 | + if (!$instance) { |
|
288 | 288 | $instance = $this->query; |
289 | 289 | } |
290 | 290 | |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | $this->totalRecords = $this->totalCount(); |
540 | 540 | |
541 | 541 | if ($this->totalRecords) { |
542 | - $this->orderRecords(! $orderFirst); |
|
542 | + $this->orderRecords(!$orderFirst); |
|
543 | 543 | $this->filterRecords(); |
544 | 544 | $this->orderRecords($orderFirst); |
545 | 545 | $this->paginate(); |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | */ |
557 | 557 | public function orderRecords($skip) |
558 | 558 | { |
559 | - if (! $skip) { |
|
559 | + if (!$skip) { |
|
560 | 560 | $this->ordering(); |
561 | 561 | } |
562 | 562 | } |
@@ -838,7 +838,7 @@ discard block |
||
838 | 838 | { |
839 | 839 | $matches = explode(' as ', Str::lower($str)); |
840 | 840 | |
841 | - if (! empty($matches)) { |
|
841 | + if (!empty($matches)) { |
|
842 | 842 | if ($wantsAlias) { |
843 | 843 | return array_pop($matches); |
844 | 844 | } else { |
@@ -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 | { |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | public function columns(array $columns) |
308 | 308 | { |
309 | 309 | foreach ($columns as $key => $value) { |
310 | - if (! is_a($value, Column::class)) { |
|
310 | + if (!is_a($value, Column::class)) { |
|
311 | 311 | if (is_array($value)) { |
312 | 312 | $attributes = array_merge(['name' => $key, 'data' => $key], $this->setTitle($key, $value)); |
313 | 313 | } else { |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | */ |
337 | 337 | public function setTitle($title, array $attributes) |
338 | 338 | { |
339 | - if (! isset($attributes['title'])) { |
|
339 | + if (!isset($attributes['title'])) { |
|
340 | 340 | $attributes['title'] = $this->getQualifiedTitle($title); |
341 | 341 | } |
342 | 342 |