@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | public function getAttribute() |
| 19 | 19 | { |
| 20 | - return function ($next, $value, $args) { |
|
| 20 | + return function($next, $value, $args) { |
|
| 21 | 21 | $key = $args->get('key'); |
| 22 | 22 | |
| 23 | 23 | if (is_null($value)) { |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function setAttribute() |
| 37 | 37 | { |
| 38 | - return function ($next, $value, $args) { |
|
| 38 | + return function($next, $value, $args) { |
|
| 39 | 39 | $key = $args->get('key'); |
| 40 | 40 | |
| 41 | 41 | if (!$this->hasColumn($key) && $this->allowsMeta($key) && !$this->hasSetMutator($key)) { |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function toArray() |
| 55 | 55 | { |
| 56 | - return function ($next, $attributes) { |
|
| 56 | + return function($next, $attributes) { |
|
| 57 | 57 | unset($attributes['meta_attributes'], $attributes['metaAttributes']); |
| 58 | 58 | |
| 59 | 59 | $attributes = array_merge($attributes, $this->getMetaAttributesArray()); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function replicate() |
| 71 | 71 | { |
| 72 | - return function ($next, $copy, $args) { |
|
| 72 | + return function($next, $copy, $args) { |
|
| 73 | 73 | $metaAttributes = $args->get('original') |
| 74 | 74 | ->getMetaAttributes() |
| 75 | 75 | ->replicate($args->get('except')); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | public function save() |
| 89 | 89 | { |
| 90 | - return function ($next, $value, $args) { |
|
| 90 | + return function($next, $value, $args) { |
|
| 91 | 91 | $this->saveMeta(); |
| 92 | 92 | |
| 93 | 93 | return $next($value, $args); |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | public function __issetHook() |
| 103 | 103 | { |
| 104 | - return function ($next, $isset, $args) { |
|
| 104 | + return function($next, $isset, $args) { |
|
| 105 | 105 | $key = $args->get('key'); |
| 106 | 106 | |
| 107 | 107 | if (!$isset) { |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | public function __unsetHook() |
| 121 | 121 | { |
| 122 | - return function ($next, $value, $args) { |
|
| 122 | + return function($next, $value, $args) { |
|
| 123 | 123 | $key = $args->get('key'); |
| 124 | 124 | |
| 125 | 125 | if ($this->hasMeta($key)) { |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | */ |
| 138 | 138 | public function queryHook() |
| 139 | 139 | { |
| 140 | - return function ($next, $query, $bag) { |
|
| 140 | + return function($next, $query, $bag) { |
|
| 141 | 141 | $method = $bag->get('method'); |
| 142 | 142 | $args = $bag->get('args'); |
| 143 | 143 | $column = $args->get('column'); |
@@ -27,12 +27,12 @@ |
||
| 27 | 27 | // We want to update each unique rule so it ignores this model's row |
| 28 | 28 | // during unique check in order to avoid faulty non-unique errors |
| 29 | 29 | // in accordance to the linked Laravel Validator documentation. |
| 30 | - array_walk($rules, function (&$fieldRules, $field) use ($id, $primaryKey) { |
|
| 30 | + array_walk($rules, function(&$fieldRules, $field) use ($id, $primaryKey) { |
|
| 31 | 31 | if (is_string($fieldRules)) { |
| 32 | 32 | $fieldRules = explode('|', $fieldRules); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - array_walk($fieldRules, function (&$rule) use ($field, $id, $primaryKey) { |
|
| 35 | + array_walk($fieldRules, function(&$rule) use ($field, $id, $primaryKey) { |
|
| 36 | 36 | if (strpos($rule, 'unique') === false) { |
| 37 | 37 | return; |
| 38 | 38 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public function queryHook() |
| 21 | 21 | { |
| 22 | - return function ($next, $query, $bag) { |
|
| 22 | + return function($next, $query, $bag) { |
|
| 23 | 23 | $method = $bag->get('method'); |
| 24 | 24 | $args = $bag->get('args'); |
| 25 | 25 | $column = $args->get('column'); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function save() |
| 47 | 47 | { |
| 48 | - return function ($next, $value, $args) { |
|
| 48 | + return function($next, $value, $args) { |
|
| 49 | 49 | $this->saveMapped(); |
| 50 | 50 | |
| 51 | 51 | return $next($value, $args); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function __issetHook() |
| 63 | 63 | { |
| 64 | - return function ($next, $isset, $args) { |
|
| 64 | + return function($next, $isset, $args) { |
|
| 65 | 65 | $key = $args->get('key'); |
| 66 | 66 | |
| 67 | 67 | if (!$isset && $this->hasMapping($key)) { |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function __unsetHook() |
| 83 | 83 | { |
| 84 | - return function ($next, $value, $args) { |
|
| 84 | + return function($next, $value, $args) { |
|
| 85 | 85 | $key = $args->get('key'); |
| 86 | 86 | |
| 87 | 87 | if ($this->hasMapping($key)) { |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | public function getAttribute() |
| 103 | 103 | { |
| 104 | - return function ($next, $value, $args) { |
|
| 104 | + return function($next, $value, $args) { |
|
| 105 | 105 | $key = $args->get('key'); |
| 106 | 106 | |
| 107 | 107 | if ($this->hasMapping($key)) { |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | public function setAttribute() |
| 123 | 123 | { |
| 124 | - return function ($next, $value, $args) { |
|
| 124 | + return function($next, $value, $args) { |
|
| 125 | 125 | $key = $args->get('key'); |
| 126 | 126 | |
| 127 | 127 | if ($this->hasMapping($key)) { |
@@ -119,8 +119,8 @@ |
||
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | $subquery->select($this->model->getTable() . '.*') |
| 122 | - ->from($this->model->getTable()) |
|
| 123 | - ->groupBy($groupByColumns); |
|
| 122 | + ->from($this->model->getTable()) |
|
| 123 | + ->groupBy($groupByColumns); |
|
| 124 | 124 | |
| 125 | 125 | $this->addSearchClauses($subquery, $columns, $words, $threshold); |
| 126 | 126 | |
@@ -108,17 +108,17 @@ discard block |
||
| 108 | 108 | $modelTableName = $this->model->getTable(); |
| 109 | 109 | |
| 110 | 110 | // If we are dealing with a SQL Server database, we need to group by all column names |
| 111 | - if ( $this->model->getConnection()->getDriverName() == 'sqlsrv' ) { |
|
| 111 | + if ($this->model->getConnection()->getDriverName() == 'sqlsrv') { |
|
| 112 | 112 | $groupByColumns = $this->model->getConnection()->getSchemaBuilder()->getColumnListing($modelTableName); |
| 113 | 113 | // Force column names to be fully-qualified |
| 114 | 114 | foreach ($groupByColumns as &$column) { |
| 115 | - $column = $modelTableName . '.' . $column; |
|
| 115 | + $column = $modelTableName.'.'.$column; |
|
| 116 | 116 | } |
| 117 | 117 | } else { |
| 118 | 118 | $groupByColumns = $this->model->getQualifiedKeyName(); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - $subquery->select($this->model->getTable() . '.*') |
|
| 121 | + $subquery->select($this->model->getTable().'.*') |
|
| 122 | 122 | ->from($this->model->getTable()) |
| 123 | 123 | ->groupBy($groupByColumns); |
| 124 | 124 | |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | if (in_array($type, $typesToMove) && $this->model->hasColumn($where['column'])) { |
| 250 | 250 | unset($this->query->wheres[$key]); |
| 251 | 251 | |
| 252 | - $where['column'] = $this->model->getTable() . '.' . $where['column']; |
|
| 252 | + $where['column'] = $this->model->getTable().'.'.$where['column']; |
|
| 253 | 253 | |
| 254 | 254 | $subquery->getQuery()->wheres[] = $where; |
| 255 | 255 | |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | protected function countBindings(array $where, $type) |
| 281 | 281 | { |
| 282 | 282 | if ($this->isHasWhere($where, $type)) { |
| 283 | - return substr_count($where['column'] . $where['value'], '?'); |
|
| 283 | + return substr_count($where['column'].$where['value'], '?'); |
|
| 284 | 284 | |
| 285 | 285 | } elseif ($type === 'basic') { |
| 286 | 286 | return (int) !$where['value'] instanceof Expression; |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | |
| 334 | 334 | $operator = $this->getLikeOperator(); |
| 335 | 335 | |
| 336 | - $bindings['select'] = $bindings['where'] = array_map(function ($word) { |
|
| 336 | + $bindings['select'] = $bindings['where'] = array_map(function($word) { |
|
| 337 | 337 | return $this->caseBinding($word); |
| 338 | 338 | }, $words); |
| 339 | 339 | |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | foreach ($words as $key => $word) { |
| 346 | 346 | if ($this->isLeftMatching($word)) { |
| 347 | 347 | $leftMatching[] = sprintf('%s %s ?', $column->getWrapped(), $operator); |
| 348 | - $bindings['select'][] = $bindings['where'][$key] = $this->caseBinding($word) . '%'; |
|
| 348 | + $bindings['select'][] = $bindings['where'][$key] = $this->caseBinding($word).'%'; |
|
| 349 | 349 | } |
| 350 | 350 | } |
| 351 | 351 | |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | foreach ($words as $key => $word) { |
| 361 | 361 | if ($this->isWildcard($word)) { |
| 362 | 362 | $wildcards[] = sprintf('%s %s ?', $column->getWrapped(), $operator); |
| 363 | - $bindings['select'][] = $bindings['where'][$key] = '%'.$this->caseBinding($word) . '%'; |
|
| 363 | + $bindings['select'][] = $bindings['where'][$key] = '%'.$this->caseBinding($word).'%'; |
|
| 364 | 364 | } |
| 365 | 365 | } |
| 366 | 366 | |
@@ -489,12 +489,12 @@ discard block |
||
| 489 | 489 | public function prefixColumnsForJoin() |
| 490 | 490 | { |
| 491 | 491 | if (!$columns = $this->query->columns) { |
| 492 | - return $this->select($this->model->getTable() . '.*'); |
|
| 492 | + return $this->select($this->model->getTable().'.*'); |
|
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | foreach ($columns as $key => $column) { |
| 496 | 496 | if ($this->model->hasColumn($column)) { |
| 497 | - $columns[$key] = $this->model->getTable() . '.' . $column; |
|
| 497 | + $columns[$key] = $this->model->getTable().'.'.$column; |
|
| 498 | 498 | } |
| 499 | 499 | } |
| 500 | 500 | |