@@ -129,7 +129,7 @@ |
||
129 | 129 | */ |
130 | 130 | public function toArray() |
131 | 131 | { |
132 | - return array_filter(array_map(function ($attribute) { |
|
132 | + return array_filter(array_map(function($attribute) { |
|
133 | 133 | return $attribute->getValue(); |
134 | 134 | }, $this->items)); |
135 | 135 | } |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | if (!$this->alreadyJoined($query, $table)) { |
256 | 256 | list($fk, $pk) = $this->getJoinKeys($relation); |
257 | 257 | |
258 | - $query->leftJoin($table, function ($join) use ($fk, $pk, $relation, $parent, $related) { |
|
258 | + $query->leftJoin($table, function($join) use ($fk, $pk, $relation, $parent, $related) { |
|
259 | 259 | $join->on($fk, '=', $pk); |
260 | 260 | |
261 | 261 | if ($relation instanceof MorphOne || $relation instanceof MorphTo) { |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | */ |
356 | 356 | protected function getMappedWhereConstraint($method, ArgumentBag $args) |
357 | 357 | { |
358 | - return function ($query) use ($method, $args) { |
|
358 | + return function($query) use ($method, $args) { |
|
359 | 359 | call_user_func_array([$query, $method], $args->all()); |
360 | 360 | }; |
361 | 361 | } |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | |
215 | 215 | $table = (new Attribute)->getTable(); |
216 | 216 | |
217 | - $query->leftJoin("{$table} as {$alias}", function ($join) use ($alias, $column) { |
|
217 | + $query->leftJoin("{$table} as {$alias}", function($join) use ($alias, $column) { |
|
218 | 218 | $join->on("{$alias}.metable_id", '=', $this->getQualifiedKeyName()) |
219 | 219 | ->where("{$alias}.metable_type", '=', $this->getMorphClass()) |
220 | 220 | ->where("{$alias}.meta_key", '=', $column); |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | return $this->getMetaBetweenConstraint($column, $args->get('values')); |
327 | 327 | } |
328 | 328 | |
329 | - return function ($query) use ($column, $method, $args) { |
|
329 | + return function($query) use ($column, $method, $args) { |
|
330 | 330 | $query->where('meta_key', $column); |
331 | 331 | |
332 | 332 | if ($args->get('value') || $args->get('values')) { |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | $min = $values[0]; |
348 | 348 | $max = $values[1]; |
349 | 349 | |
350 | - return function ($query) use ($column, $min, $max) { |
|
350 | + return function($query) use ($column, $min, $max) { |
|
351 | 351 | $query->where('meta_key', $column) |
352 | 352 | ->where('meta_value', '>=', $min) |
353 | 353 | ->where('meta_value', '<=', $max); |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | |
321 | 321 | $operator = $this->getLikeOperator(); |
322 | 322 | |
323 | - $bindings['select'] = $bindings['where'] = array_map(function ($word) { |
|
323 | + $bindings['select'] = $bindings['where'] = array_map(function($word) { |
|
324 | 324 | return $this->caseBinding($word); |
325 | 325 | }, $words); |
326 | 326 | |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | foreach ($words as $key => $word) { |
348 | 348 | if ($this->isWildcard($word)) { |
349 | 349 | $wildcards[] = sprintf('%s %s ?', $column->getWrapped(), $operator); |
350 | - $bindings['select'][] = $bindings['where'][$key] = '%'.$this->caseBinding($word) . '%'; |
|
350 | + $bindings['select'][] = $bindings['where'][$key] = '%' . $this->caseBinding($word) . '%'; |
|
351 | 351 | } |
352 | 352 | } |
353 | 353 |
@@ -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'); |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | |
39 | 39 | public function isDirty() |
40 | 40 | { |
41 | - return function ($next, $attributes = null, $bag) { |
|
41 | + return function($next, $attributes = null, $bag) { |
|
42 | 42 | if (is_array($attributes)) { |
43 | - $attributes = array_map(function ($attribute) { |
|
43 | + $attributes = array_map(function($attribute) { |
|
44 | 44 | return $this->getMappingForAttribute($attribute) ?: $attribute; |
45 | 45 | }, $attributes); |
46 | 46 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function save() |
59 | 59 | { |
60 | - return function ($next, $value, $args) { |
|
60 | + return function($next, $value, $args) { |
|
61 | 61 | $this->saveMapped(); |
62 | 62 | |
63 | 63 | return $next($value, $args); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function __issetHook() |
75 | 75 | { |
76 | - return function ($next, $isset, $args) { |
|
76 | + return function($next, $isset, $args) { |
|
77 | 77 | $key = $args->get('key'); |
78 | 78 | |
79 | 79 | if (!$isset && $this->hasMapping($key)) { |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public function __unsetHook() |
95 | 95 | { |
96 | - return function ($next, $value, $args) { |
|
96 | + return function($next, $value, $args) { |
|
97 | 97 | $key = $args->get('key'); |
98 | 98 | |
99 | 99 | if ($this->hasMapping($key)) { |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function getAttribute() |
115 | 115 | { |
116 | - return function ($next, $value, $args) { |
|
116 | + return function($next, $value, $args) { |
|
117 | 117 | $key = $args->get('key'); |
118 | 118 | |
119 | 119 | if ($this->hasMapping($key)) { |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public function setAttribute() |
135 | 135 | { |
136 | - return function ($next, $value, $args) { |
|
136 | + return function($next, $value, $args) { |
|
137 | 137 | $key = $args->get('key'); |
138 | 138 | |
139 | 139 | if ($this->hasMapping($key)) { |
@@ -146,8 +146,8 @@ discard block |
||
146 | 146 | |
147 | 147 | public function __call($method, $params) |
148 | 148 | { |
149 | - if (strpos($method, '__') === 0 && method_exists($this, $method.'Hook')) { |
|
150 | - return call_user_func_array([$this, $method.'Hook'], $params); |
|
149 | + if (strpos($method, '__') === 0 && method_exists($this, $method . 'Hook')) { |
|
150 | + return call_user_func_array([$this, $method . 'Hook'], $params); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | throw new BadMethodCallException("Method [{$method}] doesn't exist on this object."); |