@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | protected function prepareQuery() |
137 | 137 | { |
138 | - if (! $this->prepared) { |
|
138 | + if (!$this->prepared) { |
|
139 | 139 | $this->totalRecords = $this->totalCount(); |
140 | 140 | |
141 | 141 | if ($this->totalRecords) { |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | $builder = clone $this->query; |
225 | 225 | |
226 | 226 | if ($this->isComplexQuery($builder)) { |
227 | - $table = $this->connection->raw('('.$builder->toSql().') count_row_table'); |
|
227 | + $table = $this->connection->raw('(' . $builder->toSql() . ') count_row_table'); |
|
228 | 228 | |
229 | 229 | return $this->connection->table($table) |
230 | 230 | ->setBindings($builder->getBindings()); |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | |
233 | 233 | $row_count = $this->wrap('row_count'); |
234 | 234 | $builder->select($this->connection->raw("'1' as {$row_count}")); |
235 | - if (! $this->keepSelectBindings) { |
|
235 | + if (!$this->keepSelectBindings) { |
|
236 | 236 | $builder->setBindings([], 'select'); |
237 | 237 | } |
238 | 238 | |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | foreach ($columns as $index => $column) { |
306 | 306 | $column = $this->getColumnName($index); |
307 | 307 | |
308 | - if (! $this->request->isColumnSearchable($index) || $this->isBlacklisted($column) && ! $this->hasFilterColumn($column)) { |
|
308 | + if (!$this->request->isColumnSearchable($index) || $this->isBlacklisted($column) && !$this->hasFilterColumn($column)) { |
|
309 | 309 | continue; |
310 | 310 | } |
311 | 311 | |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | */ |
383 | 383 | protected function getBaseQueryBuilder($instance = null) |
384 | 384 | { |
385 | - if (! $instance) { |
|
385 | + if (!$instance) { |
|
386 | 386 | $instance = $this->query; |
387 | 387 | } |
388 | 388 | |
@@ -432,18 +432,18 @@ discard block |
||
432 | 432 | |
433 | 433 | switch ($this->connection->getDriverName()) { |
434 | 434 | case 'oracle': |
435 | - $sql = ! $this->config->isCaseInsensitive() |
|
435 | + $sql = !$this->config->isCaseInsensitive() |
|
436 | 436 | ? 'REGEXP_LIKE( ' . $column . ' , ? )' |
437 | 437 | : 'REGEXP_LIKE( LOWER(' . $column . ') , ?, \'i\' )'; |
438 | 438 | break; |
439 | 439 | |
440 | 440 | case 'pgsql': |
441 | 441 | $column = $this->castColumn($column); |
442 | - $sql = ! $this->config->isCaseInsensitive() ? $column . ' ~ ?' : $column . ' ~* ? '; |
|
442 | + $sql = !$this->config->isCaseInsensitive() ? $column . ' ~ ?' : $column . ' ~* ? '; |
|
443 | 443 | break; |
444 | 444 | |
445 | 445 | default: |
446 | - $sql = ! $this->config->isCaseInsensitive() |
|
446 | + $sql = !$this->config->isCaseInsensitive() |
|
447 | 447 | ? $column . ' REGEXP ?' |
448 | 448 | : 'LOWER(' . $column . ') REGEXP ?'; |
449 | 449 | $keyword = Str::lower($keyword); |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | { |
504 | 504 | if (strpos($column, '.') === false) { |
505 | 505 | $q = $this->getBaseQueryBuilder($query); |
506 | - if (! $q->from instanceof Expression) { |
|
506 | + if (!$q->from instanceof Expression) { |
|
507 | 507 | $column = $q->from . '.' . $column; |
508 | 508 | } |
509 | 509 | } |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | return $orderable; |
666 | 666 | }) |
667 | 667 | ->reject(function ($orderable) { |
668 | - return $this->isBlacklisted($orderable['name']) && ! $this->hasOrderColumn($orderable['name']); |
|
668 | + return $this->isBlacklisted($orderable['name']) && !$this->hasOrderColumn($orderable['name']); |
|
669 | 669 | }) |
670 | 670 | ->each(function ($orderable) { |
671 | 671 | $column = $this->resolveRelationColumn($orderable['name']); |
@@ -745,7 +745,7 @@ discard block |
||
745 | 745 | return $this->getColumnName($index); |
746 | 746 | }) |
747 | 747 | ->reject(function ($column) { |
748 | - return $this->isBlacklisted($column) && ! $this->hasFilterColumn($column); |
|
748 | + return $this->isBlacklisted($column) && !$this->hasFilterColumn($column); |
|
749 | 749 | }) |
750 | 750 | ->each(function ($column) use ($keyword, $query) { |
751 | 751 | if ($this->hasFilterColumn($column)) { |
@@ -204,8 +204,8 @@ discard block |
||
204 | 204 | $formatter = app($formatter); |
205 | 205 | } |
206 | 206 | |
207 | - if (! $formatter instanceof Formatter) { |
|
208 | - throw new \Exception('$formatter must be an instance of '. Formatter::class); |
|
207 | + if (!$formatter instanceof Formatter) { |
|
208 | + throw new \Exception('$formatter must be an instance of ' . Formatter::class); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | foreach ((array) $columns as $column) { |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | */ |
569 | 569 | public function pushToBlacklist($column) |
570 | 570 | { |
571 | - if (! $this->isBlacklisted($column)) { |
|
571 | + if (!$this->isBlacklisted($column)) { |
|
572 | 572 | $this->columnDef['blacklist'][] = $column; |
573 | 573 | } |
574 | 574 | |
@@ -762,7 +762,7 @@ discard block |
||
762 | 762 | */ |
763 | 763 | protected function paginate() |
764 | 764 | { |
765 | - if ($this->request->isPaginationable() && ! $this->skipPaging) { |
|
765 | + if ($this->request->isPaginationable() && !$this->skipPaging) { |
|
766 | 766 | $this->paging(); |
767 | 767 | } |
768 | 768 | } |
@@ -874,7 +874,7 @@ discard block |
||
874 | 874 | $error = $this->config->get('datatables.error'); |
875 | 875 | $debug = $this->config->get('app.debug'); |
876 | 876 | |
877 | - if ($error === 'throw' || (! $error && ! $debug)) { |
|
877 | + if ($error === 'throw' || (!$error && !$debug)) { |
|
878 | 878 | throw $exception; |
879 | 879 | } |
880 | 880 | |
@@ -885,7 +885,7 @@ discard block |
||
885 | 885 | 'recordsTotal' => $this->totalRecords, |
886 | 886 | 'recordsFiltered' => 0, |
887 | 887 | 'data' => [], |
888 | - 'error' => $error ? __($error) : "Exception Message:\n\n".$exception->getMessage(), |
|
888 | + 'error' => $error ? __($error) : "Exception Message:\n\n" . $exception->getMessage(), |
|
889 | 889 | ]); |
890 | 890 | } |
891 | 891 | |
@@ -923,7 +923,7 @@ discard block |
||
923 | 923 | protected function setupKeyword($value) |
924 | 924 | { |
925 | 925 | if ($this->config->isSmartSearch()) { |
926 | - $keyword = '%'.$value.'%'; |
|
926 | + $keyword = '%' . $value . '%'; |
|
927 | 927 | if ($this->config->isWildcard()) { |
928 | 928 | $keyword = Helper::wildcardLikeString($value); |
929 | 929 | } |