@@ -202,8 +202,8 @@ discard block |
||
202 | 202 | $formatter = app($formatter); |
203 | 203 | } |
204 | 204 | |
205 | - if (! $formatter instanceof Formatter) { |
|
206 | - throw new \Exception('$formatter must be an instance of '. Formatter::class); |
|
205 | + if (!$formatter instanceof Formatter) { |
|
206 | + throw new \Exception('$formatter must be an instance of ' . Formatter::class); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | foreach ((array) $columns as $column) { |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | */ |
554 | 554 | public function pushToBlacklist($column) |
555 | 555 | { |
556 | - if (! $this->isBlacklisted($column)) { |
|
556 | + if (!$this->isBlacklisted($column)) { |
|
557 | 557 | $this->columnDef['blacklist'][] = $column; |
558 | 558 | } |
559 | 559 | |
@@ -747,7 +747,7 @@ discard block |
||
747 | 747 | */ |
748 | 748 | protected function paginate() |
749 | 749 | { |
750 | - if ($this->request->isPaginationable() && ! $this->skipPaging) { |
|
750 | + if ($this->request->isPaginationable() && !$this->skipPaging) { |
|
751 | 751 | $this->paging(); |
752 | 752 | } |
753 | 753 | } |
@@ -858,7 +858,7 @@ discard block |
||
858 | 858 | $error = $this->config->get('datatables.error'); |
859 | 859 | $debug = $this->config->get('app.debug'); |
860 | 860 | |
861 | - if ($error === 'throw' || (! $error && ! $debug)) { |
|
861 | + if ($error === 'throw' || (!$error && !$debug)) { |
|
862 | 862 | throw new Exception($exception->getMessage(), $code = 0, $exception); |
863 | 863 | } |
864 | 864 | |
@@ -869,7 +869,7 @@ discard block |
||
869 | 869 | 'recordsTotal' => $this->totalRecords, |
870 | 870 | 'recordsFiltered' => 0, |
871 | 871 | 'data' => [], |
872 | - 'error' => $error ? __($error) : "Exception Message:\n\n".$exception->getMessage(), |
|
872 | + 'error' => $error ? __($error) : "Exception Message:\n\n" . $exception->getMessage(), |
|
873 | 873 | ]); |
874 | 874 | } |
875 | 875 | |
@@ -907,7 +907,7 @@ discard block |
||
907 | 907 | protected function setupKeyword($value) |
908 | 908 | { |
909 | 909 | if ($this->config->isSmartSearch()) { |
910 | - $keyword = '%'.$value.'%'; |
|
910 | + $keyword = '%' . $value . '%'; |
|
911 | 911 | if ($this->config->isWildcard()) { |
912 | 912 | $keyword = Helper::wildcardLikeString($value); |
913 | 913 | } |
@@ -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)) { |