@@ -17,7 +17,6 @@ |
||
17 | 17 | use Illuminate\Support\Str; |
18 | 18 | use yajra\Datatables\Contracts\DataTableEngine; |
19 | 19 | use yajra\Datatables\Request; |
20 | -use yajra\Datatables\Helper; |
|
21 | 20 | |
22 | 21 | class CollectionEngine extends BaseEngine implements DataTableEngine |
23 | 22 | { |
@@ -124,7 +124,7 @@ |
||
124 | 124 | $keyword = $this->request->keyword(); |
125 | 125 | foreach ($this->request->searchableColumnIndex() as $index) { |
126 | 126 | $column = $this->getColumnName($index); |
127 | - if ( ! $value = Arr::get($data, $column)) { |
|
127 | + if (!$value = Arr::get($data, $column)) { |
|
128 | 128 | continue; |
129 | 129 | } |
130 | 130 |
@@ -42,8 +42,8 @@ |
||
42 | 42 | */ |
43 | 43 | public function rowValue($attribute, $template) |
44 | 44 | { |
45 | - if ( ! empty($template)) { |
|
46 | - if ( ! is_callable($template) && Arr::get($this->data, $template)) { |
|
45 | + if (!empty($template)) { |
|
46 | + if (!is_callable($template) && Arr::get($this->data, $template)) { |
|
47 | 47 | $this->data[$attribute] = Arr::get($this->data, $template); |
48 | 48 | } else { |
49 | 49 | $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 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function orderableColumns() |
71 | 71 | { |
72 | - if ( ! $this->isOrderable()) { |
|
72 | + if (!$this->isOrderable()) { |
|
73 | 73 | return []; |
74 | 74 | } |
75 | 75 | |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | */ |
169 | 169 | public function isPaginationable() |
170 | 170 | { |
171 | - return ! is_null($this->get('start')) && ! is_null($this->get('length')) && $this->get('length') != -1; |
|
171 | + return !is_null($this->get('start')) && !is_null($this->get('length')) && $this->get('length') != -1; |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | } |
@@ -132,7 +132,7 @@ |
||
132 | 132 | */ |
133 | 133 | public static function getOrMethod($method) |
134 | 134 | { |
135 | - if ( ! Str::contains(Str::lower($method), 'or')) { |
|
135 | + if (!Str::contains(Str::lower($method), 'or')) { |
|
136 | 136 | return 'or' . ucfirst($method); |
137 | 137 | } |
138 | 138 |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | { |
259 | 259 | $matches = explode(' as ', Str::lower($str)); |
260 | 260 | |
261 | - if (! empty($matches)) { |
|
261 | + if (!empty($matches)) { |
|
262 | 262 | if ($wantsAlias) { |
263 | 263 | return array_pop($matches); |
264 | 264 | } else { |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | foreach ($joins as $join) { |
310 | 310 | $table = preg_split('/ as /i', $join->table); |
311 | 311 | $names[] = $table[0]; |
312 | - if (isset($table[1]) && ! empty($databasePrefix) && strpos($table[1], $databasePrefix) == 0) { |
|
312 | + if (isset($table[1]) && !empty($databasePrefix) && strpos($table[1], $databasePrefix) == 0) { |
|
313 | 313 | $names[] = preg_replace('/^' . $databasePrefix . '/', '', $table[1]); |
314 | 314 | } |
315 | 315 | } |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | */ |
326 | 326 | public function getQueryBuilder($instance = null) |
327 | 327 | { |
328 | - if (! $instance) { |
|
328 | + if (!$instance) { |
|
329 | 329 | $instance = $this->query; |
330 | 330 | } |
331 | 331 | |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | $this->totalRecords = $this->count(); |
580 | 580 | |
581 | 581 | if ($this->totalRecords) { |
582 | - $this->orderRecords(! $orderFirst); |
|
582 | + $this->orderRecords(!$orderFirst); |
|
583 | 583 | $this->filterRecords(); |
584 | 584 | $this->orderRecords($orderFirst); |
585 | 585 | $this->paginate(); |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | */ |
604 | 604 | public function orderRecords($skip) |
605 | 605 | { |
606 | - if (! $skip) { |
|
606 | + if (!$skip) { |
|
607 | 607 | $this->ordering(); |
608 | 608 | } |
609 | 609 | } |
@@ -77,7 +77,7 @@ |
||
77 | 77 | $myQuery = clone $this->query; |
78 | 78 | // if its a normal query ( no union, having and distinct word ) |
79 | 79 | // replace the select with static text to improve performance |
80 | - if (! Str::contains(Str::lower($myQuery->toSql()), ['union', 'having', 'distinct'])) { |
|
80 | + if (!Str::contains(Str::lower($myQuery->toSql()), ['union', 'having', 'distinct'])) { |
|
81 | 81 | $row_count = $this->connection->getQueryGrammar()->wrap('row_count'); |
82 | 82 | $myQuery->select($this->connection->raw("'1' as {$row_count}")); |
83 | 83 | } |
@@ -189,7 +189,7 @@ |
||
189 | 189 | */ |
190 | 190 | public function setTitle($title, array $attributes) |
191 | 191 | { |
192 | - if ( ! isset($attributes['title'])) { |
|
192 | + if (!isset($attributes['title'])) { |
|
193 | 193 | $attributes['title'] = $this->getQualifiedTitle($title); |
194 | 194 | } |
195 | 195 |