@@ -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 | * |
@@ -164,7 +164,7 @@ |
||
164 | 164 | $name = str_replace('/', '\\', $name); |
165 | 165 | } |
166 | 166 | |
167 | - if (! Str::contains(Str::lower($name), 'datatable')) { |
|
167 | + if (!Str::contains(Str::lower($name), 'datatable')) { |
|
168 | 168 | $name .= 'DataTable'; |
169 | 169 | } |
170 | 170 |
@@ -333,7 +333,7 @@ |
||
333 | 333 | ])->setOrientation('landscape'); |
334 | 334 | |
335 | 335 | return $snappy->loadView($this->printPreview, compact('data')) |
336 | - ->download($this->getFilename() . ".pdf"); |
|
336 | + ->download($this->getFilename() . ".pdf"); |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | /** |
@@ -347,7 +347,7 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $myQuery = clone $this->query; |
96 | 96 | // if its a normal query ( no union, having and distinct word ) |
97 | 97 | // replace the select with static text to improve performance |
98 | - if (! Str::contains(Str::lower($myQuery->toSql()), ['union', 'having', 'distinct', 'order by', 'group by'])) { |
|
98 | + if (!Str::contains(Str::lower($myQuery->toSql()), ['union', 'having', 'distinct', 'order by', 'group by'])) { |
|
99 | 99 | $row_count = $this->wrap('row_count'); |
100 | 100 | $myQuery->select($this->connection->raw("'1' as {$row_count}")); |
101 | 101 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $columnDef = $this->columnDef['filter'][$columnName]; |
139 | 139 | // check if global search should be applied for the specific column |
140 | 140 | $applyGlobalSearch = count($columnDef['parameters']) == 0 || end($columnDef['parameters']) !== false; |
141 | - if (! $applyGlobalSearch) { |
|
141 | + if (!$applyGlobalSearch) { |
|
142 | 142 | continue; |
143 | 143 | } |
144 | 144 | |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | $columns = $this->request->get('columns', []); |
334 | 334 | |
335 | 335 | foreach ($columns as $index => $column) { |
336 | - if (! $this->request->isColumnSearchable($index)) { |
|
336 | + if (!$this->request->isColumnSearchable($index)) { |
|
337 | 337 | continue; |
338 | 338 | } |
339 | 339 | |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | $pivotPK = $model->getForeignKey(); |
415 | 415 | $pivotFK = $model->getQualifiedParentKeyName(); |
416 | 416 | |
417 | - if (! in_array($pivot, $joins)) { |
|
417 | + if (!in_array($pivot, $joins)) { |
|
418 | 418 | $this->getQueryBuilder()->leftJoin($pivot, $pivotPK, '=', $pivotFK); |
419 | 419 | } |
420 | 420 | |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | $tablePK = $related->getForeignKey(); |
424 | 424 | $tableFK = $related->getQualifiedKeyName(); |
425 | 425 | |
426 | - if (! in_array($table, $joins)) { |
|
426 | + if (!in_array($table, $joins)) { |
|
427 | 427 | $this->getQueryBuilder()->leftJoin($table, $pivot . '.' . $tablePK, '=', $tableFK); |
428 | 428 | } |
429 | 429 | } else { |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | $other = $model->getQualifiedOtherKeyName(); |
437 | 437 | } |
438 | 438 | |
439 | - if (! in_array($table, $joins)) { |
|
439 | + if (!in_array($table, $joins)) { |
|
440 | 440 | $this->getQueryBuilder()->leftJoin($table, $foreign, '=', $other); |
441 | 441 | } |
442 | 442 | } |
@@ -472,10 +472,10 @@ discard block |
||
472 | 472 | protected function regexColumnSearch($column, $keyword) |
473 | 473 | { |
474 | 474 | if ($this->isOracleSql()) { |
475 | - $sql = ! $this->isCaseInsensitive() ? 'REGEXP_LIKE( ' . $column . ' , ? )' : 'REGEXP_LIKE( LOWER(' . $column . ') , ?, \'i\' )'; |
|
475 | + $sql = !$this->isCaseInsensitive() ? 'REGEXP_LIKE( ' . $column . ' , ? )' : 'REGEXP_LIKE( LOWER(' . $column . ') , ?, \'i\' )'; |
|
476 | 476 | $this->query->whereRaw($sql, [$keyword]); |
477 | 477 | } else { |
478 | - $sql = ! $this->isCaseInsensitive() ? $column . ' REGEXP ?' : 'LOWER(' . $column . ') REGEXP ?'; |
|
478 | + $sql = !$this->isCaseInsensitive() ? $column . ' REGEXP ?' : 'LOWER(' . $column . ') REGEXP ?'; |
|
479 | 479 | $this->query->whereRaw($sql, [Str::lower($keyword)]); |
480 | 480 | } |
481 | 481 | } |
@@ -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 |