@@ -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 | } |
@@ -856,7 +856,7 @@ |
||
856 | 856 | return $this; |
857 | 857 | } |
858 | 858 | |
859 | - /** |
|
859 | + /** |
|
860 | 860 | * Check if the current sql language is based on oracle syntax. |
861 | 861 | * |
862 | 862 | * @return bool |
@@ -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 |
@@ -224,7 +224,7 @@ |
||
224 | 224 | */ |
225 | 225 | public function setTitle($title, array $attributes) |
226 | 226 | { |
227 | - if (! isset($attributes['title'])) { |
|
227 | + if (!isset($attributes['title'])) { |
|
228 | 228 | $attributes['title'] = $this->getQualifiedTitle($title); |
229 | 229 | } |
230 | 230 |
@@ -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 | * |
@@ -204,6 +204,7 @@ |
||
204 | 204 | * @param mixed $query |
205 | 205 | * @param string $column |
206 | 206 | * @param string $keyword |
207 | + * @param string $relation |
|
207 | 208 | */ |
208 | 209 | protected function compileRelationSearch($query, $relation, $column, $keyword) |
209 | 210 | { |
@@ -270,22 +270,22 @@ |
||
270 | 270 | $column = $this->castColumn($column); |
271 | 271 | if ($this->isCaseInsensitive()) { |
272 | 272 | if ($this->request->isRegex($i)) { |
273 | - if($this->isOracleSql()){ |
|
274 | - $this->query->whereRaw(' REGEXP_LIKE( LOWER('.$column.') , ?, \'i\' )', [$keyword]); |
|
275 | - }else{ |
|
276 | - $this->query->whereRaw('LOWER(' . $column . ') REGEXP ?', [Str::lower($keyword)]); |
|
277 | - } |
|
273 | + if($this->isOracleSql()){ |
|
274 | + $this->query->whereRaw(' REGEXP_LIKE( LOWER('.$column.') , ?, \'i\' )', [$keyword]); |
|
275 | + }else{ |
|
276 | + $this->query->whereRaw('LOWER(' . $column . ') REGEXP ?', [Str::lower($keyword)]); |
|
277 | + } |
|
278 | 278 | } else { |
279 | 279 | $this->query->whereRaw('LOWER(' . $column . ') LIKE ?', [Str::lower($keyword)]); |
280 | 280 | } |
281 | 281 | } else { |
282 | 282 | $col = strstr($column, '(') ? $this->connection->raw($column) : $column; |
283 | 283 | if ($this->request->isRegex($i)) { |
284 | - if($this->isOracleSql()){ |
|
285 | - $this->query->whereRaw(' REGEXP_LIKE( '.$col.' , ? )', [$keyword]); |
|
286 | - }else{ |
|
287 | - $this->query->whereRaw($col . ' REGEXP ?', [$keyword]); |
|
288 | - } |
|
284 | + if($this->isOracleSql()){ |
|
285 | + $this->query->whereRaw(' REGEXP_LIKE( '.$col.' , ? )', [$keyword]); |
|
286 | + }else{ |
|
287 | + $this->query->whereRaw($col . ' REGEXP ?', [$keyword]); |
|
288 | + } |
|
289 | 289 | } else { |
290 | 290 | $this->query->whereRaw($col . ' LIKE ?', [$keyword]); |
291 | 291 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $myQuery = clone $this->query; |
86 | 86 | // if its a normal query ( no union, having and distinct word ) |
87 | 87 | // replace the select with static text to improve performance |
88 | - if (! Str::contains(Str::lower($myQuery->toSql()), ['union', 'having', 'distinct', 'order by', 'group by'])) { |
|
88 | + if (!Str::contains(Str::lower($myQuery->toSql()), ['union', 'having', 'distinct', 'order by', 'group by'])) { |
|
89 | 89 | $row_count = $this->connection->getQueryGrammar()->wrap('row_count'); |
90 | 90 | $myQuery->select($this->connection->raw("'1' as {$row_count}")); |
91 | 91 | } |
@@ -270,9 +270,9 @@ discard block |
||
270 | 270 | $column = $this->castColumn($column); |
271 | 271 | if ($this->isCaseInsensitive()) { |
272 | 272 | if ($this->request->isRegex($i)) { |
273 | - if($this->isOracleSql()){ |
|
274 | - $this->query->whereRaw(' REGEXP_LIKE( LOWER('.$column.') , ?, \'i\' )', [$keyword]); |
|
275 | - }else{ |
|
273 | + if ($this->isOracleSql()) { |
|
274 | + $this->query->whereRaw(' REGEXP_LIKE( LOWER(' . $column . ') , ?, \'i\' )', [$keyword]); |
|
275 | + } else { |
|
276 | 276 | $this->query->whereRaw('LOWER(' . $column . ') REGEXP ?', [Str::lower($keyword)]); |
277 | 277 | } |
278 | 278 | } else { |
@@ -281,9 +281,9 @@ discard block |
||
281 | 281 | } else { |
282 | 282 | $col = strstr($column, '(') ? $this->connection->raw($column) : $column; |
283 | 283 | if ($this->request->isRegex($i)) { |
284 | - if($this->isOracleSql()){ |
|
285 | - $this->query->whereRaw(' REGEXP_LIKE( '.$col.' , ? )', [$keyword]); |
|
286 | - }else{ |
|
284 | + if ($this->isOracleSql()) { |
|
285 | + $this->query->whereRaw(' REGEXP_LIKE( ' . $col . ' , ? )', [$keyword]); |
|
286 | + } else { |
|
287 | 287 | $this->query->whereRaw($col . ' REGEXP ?', [$keyword]); |
288 | 288 | } |
289 | 289 | } else { |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | if ($this->request->isRegex($i)) { |
273 | 273 | if($this->isOracleSql()){ |
274 | 274 | $this->query->whereRaw(' REGEXP_LIKE( LOWER('.$column.') , ?, \'i\' )', [$keyword]); |
275 | - }else{ |
|
275 | + } else{ |
|
276 | 276 | $this->query->whereRaw('LOWER(' . $column . ') REGEXP ?', [Str::lower($keyword)]); |
277 | 277 | } |
278 | 278 | } else { |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | if ($this->request->isRegex($i)) { |
284 | 284 | if($this->isOracleSql()){ |
285 | 285 | $this->query->whereRaw(' REGEXP_LIKE( '.$col.' , ? )', [$keyword]); |
286 | - }else{ |
|
286 | + } else{ |
|
287 | 287 | $this->query->whereRaw($col . ' REGEXP ?', [$keyword]); |
288 | 288 | } |
289 | 289 | } else { |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | return [ |
4 | 4 | |
5 | - 'oracle_sql' => false, |
|
5 | + 'oracle_sql' => false, |
|
6 | 6 | |
7 | 7 | 'search' => [ |
8 | 8 | 'case_insensitive' => true, |