@@ -108,8 +108,8 @@ |
||
| 108 | 108 | : (float) $threshold ; |
| 109 | 109 | |
| 110 | 110 | $subquery->select($this->model->getTable().'.*') |
| 111 | - ->from($this->model->getTable()) |
|
| 112 | - ->groupBy($this->model->getQualifiedKeyName()); |
|
| 111 | + ->from($this->model->getTable()) |
|
| 112 | + ->groupBy($this->model->getQualifiedKeyName()); |
|
| 113 | 113 | |
| 114 | 114 | $this->addSearchClauses($subquery, $columns, $words, $threshold); |
| 115 | 115 | |
@@ -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'); |
@@ -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)) { |
@@ -134,8 +134,8 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | public function __call($method, $params) |
| 136 | 136 | { |
| 137 | - if (strpos($method, '__') === 0 && method_exists($this, $method.'Hook')) { |
|
| 138 | - return call_user_func_array([$this, $method.'Hook'], $params); |
|
| 137 | + if (strpos($method, '__') === 0 && method_exists($this, $method . 'Hook')) { |
|
| 138 | + return call_user_func_array([$this, $method . 'Hook'], $params); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | throw new BadMethodCallException("Method [{$method}] doesn't exist on this object."); |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function up() |
| 28 | 28 | { |
| 29 | - \Schema::create($this->table, function (Blueprint $table) { |
|
| 29 | + \Schema::create($this->table, function(Blueprint $table) { |
|
| 30 | 30 | $table->increments('meta_id'); |
| 31 | 31 | $table->string('meta_key'); |
| 32 | 32 | $table->longText('meta_value'); |
@@ -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'); |
@@ -156,8 +156,8 @@ discard block |
||
| 156 | 156 | |
| 157 | 157 | public function __call($method, $params) |
| 158 | 158 | { |
| 159 | - if (strpos($method, '__') === 0 && method_exists($this, $method.'Hook')) { |
|
| 160 | - return call_user_func_array([$this, $method.'Hook'], $params); |
|
| 159 | + if (strpos($method, '__') === 0 && method_exists($this, $method . 'Hook')) { |
|
| 160 | + return call_user_func_array([$this, $method . 'Hook'], $params); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | throw new BadMethodCallException("Method [{$method}] doesn't exist on this object."); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | public function getAttribute() |
| 17 | 17 | { |
| 18 | - return function ($next, $value, $args) { |
|
| 18 | + return function($next, $value, $args) { |
|
| 19 | 19 | $key = $args->get('key'); |
| 20 | 20 | |
| 21 | 21 | if ($this->hasGetterMutator($key)) { |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function setAttribute() |
| 35 | 35 | { |
| 36 | - return function ($next, $value, $args) { |
|
| 36 | + return function($next, $value, $args) { |
|
| 37 | 37 | $key = $args->get('key'); |
| 38 | 38 | |
| 39 | 39 | if ($this->hasSetterMutator($key)) { |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public function toArray() |
| 53 | 53 | { |
| 54 | - return function ($next, $attributes) { |
|
| 54 | + return function($next, $attributes) { |
|
| 55 | 55 | $attributes = $this->mutableAttributesToArray($attributes); |
| 56 | 56 | |
| 57 | 57 | return $next($attributes); |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $fk = $relation->getForeignKey(); |
| 157 | 157 | } else { |
| 158 | 158 | $table = $relation->getParent()->getTable(); |
| 159 | - $fk = $table.'.'.$parent->getForeignKey(); |
|
| 159 | + $fk = $table . '.' . $parent->getForeignKey(); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | $pk = $parent->getQualifiedKeyName(); |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | if ($relation instanceof HasManyThrough) { |
| 196 | - $fk = $relation->getRelated()->getTable().'.'.$relation->getParent()->getForeignKey(); |
|
| 196 | + $fk = $relation->getRelated()->getTable() . '.' . $relation->getParent()->getForeignKey(); |
|
| 197 | 197 | |
| 198 | 198 | return [$fk, $relation->getParent()->getQualifiedKeyName()]; |
| 199 | 199 | } |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | */ |
| 56 | 56 | public function getQualifiedName() |
| 57 | 57 | { |
| 58 | - return $this->getTable().'.'.$this->getName(); |
|
| 58 | + return $this->getTable() . '.' . $this->getName(); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function getQualifiedNames() |
| 52 | 52 | { |
| 53 | - return array_map(function ($column) { |
|
| 53 | + return array_map(function($column) { |
|
| 54 | 54 | return $column->getQualifiedName(); |
| 55 | 55 | }, $this->columns); |
| 56 | 56 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function getTables() |
| 64 | 64 | { |
| 65 | - return array_unique(array_map(function ($column) { |
|
| 65 | + return array_unique(array_map(function($column) { |
|
| 66 | 66 | return $column->getTable(); |
| 67 | 67 | }, $this->columns)); |
| 68 | 68 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | public function getMappings() |
| 92 | 92 | { |
| 93 | - return array_map(function ($column) { |
|
| 93 | + return array_map(function($column) { |
|
| 94 | 94 | return $column->getMapping(); |
| 95 | 95 | }, $this->columns); |
| 96 | 96 | } |
@@ -117,7 +117,7 @@ |
||
| 117 | 117 | { |
| 118 | 118 | $token = $this->wildcard; |
| 119 | 119 | |
| 120 | - return array_map(function ($word) use ($token) { |
|
| 120 | + return array_map(function($word) use ($token) { |
|
| 121 | 121 | return preg_replace('/\*+/', '*', "{$token}{$word}{$token}"); |
| 122 | 122 | }, $words); |
| 123 | 123 | } |