@@ -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'); |
@@ -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); |
@@ -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 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | protected function registerMutator() |
| 41 | 41 | { |
| 42 | - $this->app->singleton('eloquence.mutator', function () { |
|
| 42 | + $this->app->singleton('eloquence.mutator', function() { |
|
| 43 | 43 | return new Mutator; |
| 44 | 44 | }); |
| 45 | 45 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | protected function registerJoiner() |
| 55 | 55 | { |
| 56 | - $this->app->singleton('eloquence.joiner', function () { |
|
| 56 | + $this->app->singleton('eloquence.joiner', function() { |
|
| 57 | 57 | return new JoinerFactory; |
| 58 | 58 | }); |
| 59 | 59 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | protected function registerParser() |
| 69 | 69 | { |
| 70 | - $this->app->singleton('eloquence.parser', function () { |
|
| 70 | + $this->app->singleton('eloquence.parser', function() { |
|
| 71 | 71 | return new ParserFactory; |
| 72 | 72 | }); |
| 73 | 73 | |
@@ -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 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * Determine whether where should be treated as whereNull. |
| 64 | 64 | * |
| 65 | 65 | * @param string $method |
| 66 | - * @param Sofa\Hookable\Contracts\ArgumentBag $args |
|
| 66 | + * @param ArgumentBag $args |
|
| 67 | 67 | * @return boolean |
| 68 | 68 | */ |
| 69 | 69 | protected function isWhereNull($method, ArgumentBag $args) |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | /** |
| 75 | 75 | * Determine whether where is a whereNull by the arguments passed to where method. |
| 76 | 76 | * |
| 77 | - * @param Sofa\Hookable\Contracts\ArgumentBag $args |
|
| 77 | + * @param ArgumentBag $args |
|
| 78 | 78 | * @return boolean |
| 79 | 79 | */ |
| 80 | 80 | protected function isWhereNullByArgs(ArgumentBag $args) |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | /** |
| 364 | 364 | * Get boolean called on the original method and set it to default. |
| 365 | 365 | * |
| 366 | - * @param \Sofa\EloquenceArgumentBag $args |
|
| 366 | + * @param ArgumentBag $args |
|
| 367 | 367 | * @return string |
| 368 | 368 | */ |
| 369 | 369 | protected function getMappedBoolean(ArgumentBag $args) |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | * |
| 485 | 485 | * @param \Illuminate\Database\Eloquent\Model $target |
| 486 | 486 | * @param array $segments |
| 487 | - * @return mixed |
|
| 487 | + * @return EloquentModel |
|
| 488 | 488 | */ |
| 489 | 489 | protected function getTarget($target, array $segments) |
| 490 | 490 | { |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | protected function mappedSelectListsKey(Builder $query, $key) |
| 216 | 216 | { |
| 217 | 217 | if ($this->hasColumn($key)) { |
| 218 | - return $query->addSelect($this->getTable() . '.' . $key); |
|
| 218 | + return $query->addSelect($this->getTable().'.'.$key); |
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | return $query->addSelect($key); |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | if (!$this->alreadyJoined($query, $table)) { |
| 262 | 262 | list($fk, $pk) = $this->getJoinKeys($relation); |
| 263 | 263 | |
| 264 | - $query->leftJoin($table, function ($join) use ($fk, $pk, $relation, $parent, $related) { |
|
| 264 | + $query->leftJoin($table, function($join) use ($fk, $pk, $relation, $parent, $related) { |
|
| 265 | 265 | $join->on($fk, '=', $pk); |
| 266 | 266 | |
| 267 | 267 | if ($relation instanceof MorphOne || $relation instanceof MorphTo) { |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | */ |
| 362 | 362 | protected function getMappedWhereConstraint($method, ArgumentBag $args) |
| 363 | 363 | { |
| 364 | - return function ($query) use ($method, $args) { |
|
| 364 | + return function($query) use ($method, $args) { |
|
| 365 | 365 | call_user_func_array([$query, $method], $args->all()); |
| 366 | 366 | }; |
| 367 | 367 | } |
@@ -259,7 +259,7 @@ |
||
| 259 | 259 | /** |
| 260 | 260 | * Get boolean called on the original method and set it to default. |
| 261 | 261 | * |
| 262 | - * @param \Sofa\EloquenceArgumentBag $args |
|
| 262 | + * @param ArgumentBag $args |
|
| 263 | 263 | * @return string |
| 264 | 264 | */ |
| 265 | 265 | protected function getMetaBoolean(ArgumentBag $args) |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | if (strpos($key, '.') !== false) { |
| 183 | 183 | return $query->addSelect($key); |
| 184 | 184 | } elseif ($this->hasColumn($key)) { |
| 185 | - return $query->addSelect($this->getTable() . '.' . $key); |
|
| 185 | + return $query->addSelect($this->getTable().'.'.$key); |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | $alias = $this->joinMeta($query, $key); |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | |
| 220 | 220 | $table = (new Attribute)->getTable(); |
| 221 | 221 | |
| 222 | - $query->leftJoin("{$table} as {$alias}", function ($join) use ($alias, $column) { |
|
| 222 | + $query->leftJoin("{$table} as {$alias}", function($join) use ($alias, $column) { |
|
| 223 | 223 | $join->on("{$alias}.metable_id", '=', $this->getQualifiedKeyName()) |
| 224 | 224 | ->where("{$alias}.metable_type", '=', $this->getMorphClass()) |
| 225 | 225 | ->where("{$alias}.meta_key", '=', $column); |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | */ |
| 236 | 236 | protected function generateMetaAlias() |
| 237 | 237 | { |
| 238 | - return md5(microtime(true)) . '_meta_alias'; |
|
| 238 | + return md5(microtime(true)).'_meta_alias'; |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | /** |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | return $this->getMetaBetweenConstraint($column, $args->get('values')); |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | - return function ($query) use ($column, $method, $args) { |
|
| 334 | + return function($query) use ($column, $method, $args) { |
|
| 335 | 335 | $query->where('meta_key', $column); |
| 336 | 336 | |
| 337 | 337 | if ($args->get('value') || $args->get('values')) { |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | $min = $values[0]; |
| 353 | 353 | $max = $values[1]; |
| 354 | 354 | |
| 355 | - return function ($query) use ($column, $min, $max) { |
|
| 355 | + return function($query) use ($column, $min, $max) { |
|
| 356 | 356 | $query->where('meta_key', $column) |
| 357 | 357 | ->where('meta_value', '>=', $min) |
| 358 | 358 | ->where('meta_value', '<=', $max); |