@@ -473,7 +473,7 @@ |
||
| 473 | 473 | /** |
| 474 | 474 | * Prefix selected columns with table name in order to avoid collisions. |
| 475 | 475 | * |
| 476 | - * @return void |
|
| 476 | + * @return Builder|null |
|
| 477 | 477 | */ |
| 478 | 478 | public function prefixColumnsForJoin() |
| 479 | 479 | { |
@@ -2,8 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Sofa\Eloquence; |
| 4 | 4 | |
| 5 | -use Closure; |
|
| 6 | -use InvalidArgumentException; |
|
| 7 | 5 | use Sofa\Eloquence\Searchable\Column; |
| 8 | 6 | use Illuminate\Database\Query\Expression; |
| 9 | 7 | use Sofa\Hookable\Builder as HookableBuilder; |
@@ -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 | |
@@ -105,9 +105,9 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | $threshold = (is_null($threshold)) |
| 107 | 107 | ? array_sum($columns->getWeights()) / 4 |
| 108 | - : (float) $threshold ; |
|
| 108 | + : (float) $threshold; |
|
| 109 | 109 | |
| 110 | - $subquery->select($this->model->getTable().'.*') |
|
| 110 | + $subquery->select($this->model->getTable() . '.*') |
|
| 111 | 111 | ->from($this->model->getTable()) |
| 112 | 112 | ->groupBy($this->model->getQualifiedKeyName()); |
| 113 | 113 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $whereBindings = $this->searchSelect($subquery, $columns, $words, $threshold); |
| 135 | 135 | |
| 136 | 136 | // For morphOne/morphMany support we need to port the bindings from JoinClauses. |
| 137 | - $joinBindings = array_flatten(array_pluck((array)$subquery->getQuery()->joins, 'bindings')); |
|
| 137 | + $joinBindings = array_flatten(array_pluck((array) $subquery->getQuery()->joins, 'bindings')); |
|
| 138 | 138 | |
| 139 | 139 | $this->addBinding($joinBindings, 'select'); |
| 140 | 140 | |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | if (in_array($type, $typesToMove) && $this->model->hasColumn($where['column'])) { |
| 239 | 239 | unset($this->query->wheres[$key]); |
| 240 | 240 | |
| 241 | - $where['column'] = $this->model->getTable().'.'.$where['column']; |
|
| 241 | + $where['column'] = $this->model->getTable() . '.' . $where['column']; |
|
| 242 | 242 | |
| 243 | 243 | $subquery->getQuery()->wheres[] = $where; |
| 244 | 244 | |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | protected function countBindings(array $where, $type) |
| 270 | 270 | { |
| 271 | 271 | if ($this->isHasWhere($where, $type)) { |
| 272 | - return substr_count($where['column'].$where['value'], '?'); |
|
| 272 | + return substr_count($where['column'] . $where['value'], '?'); |
|
| 273 | 273 | |
| 274 | 274 | } elseif ($type === 'basic') { |
| 275 | 275 | return (int) !$where['value'] instanceof Expression; |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | |
| 323 | 323 | $operator = $this->getLikeOperator(); |
| 324 | 324 | |
| 325 | - $bindings['select'] = $bindings['where'] = array_map(function ($word) { |
|
| 325 | + $bindings['select'] = $bindings['where'] = array_map(function($word) { |
|
| 326 | 326 | return $this->caseBinding($word); |
| 327 | 327 | }, $words); |
| 328 | 328 | |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | foreach ($words as $key => $word) { |
| 335 | 335 | if ($this->isLeftMatching($word)) { |
| 336 | 336 | $leftMatching[] = sprintf('%s %s ?', $column->getWrapped(), $operator); |
| 337 | - $bindings['select'][] = $bindings['where'][$key] = $this->caseBinding($word).'%'; |
|
| 337 | + $bindings['select'][] = $bindings['where'][$key] = $this->caseBinding($word) . '%'; |
|
| 338 | 338 | } |
| 339 | 339 | } |
| 340 | 340 | |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | foreach ($words as $key => $word) { |
| 350 | 350 | if ($this->isWildcard($word)) { |
| 351 | 351 | $wildcards[] = sprintf('%s %s ?', $column->getWrapped(), $operator); |
| 352 | - $bindings['select'][] = $bindings['where'][$key] = '%'.$this->caseBinding($word).'%'; |
|
| 352 | + $bindings['select'][] = $bindings['where'][$key] = '%' . $this->caseBinding($word) . '%'; |
|
| 353 | 353 | } |
| 354 | 354 | } |
| 355 | 355 | |
@@ -478,12 +478,12 @@ discard block |
||
| 478 | 478 | public function prefixColumnsForJoin() |
| 479 | 479 | { |
| 480 | 480 | if (!$columns = $this->query->columns) { |
| 481 | - return $this->select($this->model->getTable().'.*'); |
|
| 481 | + return $this->select($this->model->getTable() . '.*'); |
|
| 482 | 482 | } |
| 483 | 483 | |
| 484 | 484 | foreach ($columns as $key => $column) { |
| 485 | 485 | if ($this->model->hasColumn($column)) { |
| 486 | - $columns[$key] = $this->model->getTable().'.'.$column; |
|
| 486 | + $columns[$key] = $this->model->getTable() . '.' . $column; |
|
| 487 | 487 | } |
| 488 | 488 | } |
| 489 | 489 | |
@@ -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\Eloquence\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\Eloquence\ArgumentBag $args |
|
| 77 | + * @param ArgumentBag $args |
|
| 78 | 78 | * @return boolean |
| 79 | 79 | */ |
| 80 | 80 | protected function isWhereNullByArgs(ArgumentBag $args) |
@@ -127,7 +127,7 @@ |
||
| 127 | 127 | { |
| 128 | 128 | static::loadColumnListing(); |
| 129 | 129 | |
| 130 | - return in_array((string)$key, static::$columnListing); |
|
| 130 | + return in_array((string) $key, static::$columnListing); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /** |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * |
| 61 | 61 | * @param \Sofa\Eloquence\Builder $query |
| 62 | 62 | * @param string $method |
| 63 | - * @param \Sofa\Eloquence\ArgumentBag $args |
|
| 63 | + * @param ArgumentBag $args |
|
| 64 | 64 | * @return mixed |
| 65 | 65 | */ |
| 66 | 66 | protected function mappedQuery(Builder $query, $method, ArgumentBag $args) |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * Adjust mapped columns for select statement. |
| 81 | 81 | * |
| 82 | 82 | * @param \Sofa\Eloquence\Builder $query |
| 83 | - * @param \Sofa\Eloquence\ArgumentBag $args |
|
| 83 | + * @param ArgumentBag $args |
|
| 84 | 84 | * @return void |
| 85 | 85 | */ |
| 86 | 86 | protected function mappedSelect(Builder $query, ArgumentBag $args) |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * |
| 123 | 123 | * @param \Sofa\Eloquence\Builder $query |
| 124 | 124 | * @param string $method |
| 125 | - * @param \Sofa\Eloquence\ArgumentBag $args |
|
| 125 | + * @param ArgumentBag $args |
|
| 126 | 126 | * @param string $mapping |
| 127 | 127 | * @return mixed |
| 128 | 128 | */ |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | * |
| 143 | 143 | * @param \Sofa\Eloquence\Builder $query |
| 144 | 144 | * @param string $method |
| 145 | - * @param \Sofa\Eloquence\ArgumentBag $args |
|
| 145 | + * @param ArgumentBag $args |
|
| 146 | 146 | * @param string $target |
| 147 | 147 | * @param string $column |
| 148 | 148 | * @return mixed |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | * Order query by mapped attribute. |
| 165 | 165 | * |
| 166 | 166 | * @param \Sofa\Eloquence\Builder $query |
| 167 | - * @param \Sofa\Eloquence\ArgumentBag $args |
|
| 167 | + * @param ArgumentBag $args |
|
| 168 | 168 | * @param string $table |
| 169 | 169 | * @param string $column |
| 170 | 170 | * @param string $target |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | * Get an array with the values of given mapped attribute. |
| 182 | 182 | * |
| 183 | 183 | * @param \Sofa\Eloquence\Builder $query |
| 184 | - * @param \Sofa\Eloquence\ArgumentBag $args |
|
| 184 | + * @param ArgumentBag $args |
|
| 185 | 185 | * @param string $table |
| 186 | 186 | * @param string $column |
| 187 | 187 | * @return array |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | * |
| 329 | 329 | * @param \Sofa\Eloquence\Builder $query |
| 330 | 330 | * @param string $method |
| 331 | - * @param \Sofa\Eloquence\ArgumentBag $args |
|
| 331 | + * @param ArgumentBag $args |
|
| 332 | 332 | * @param string $target |
| 333 | 333 | * @param string $column |
| 334 | 334 | * @return \Sofa\Eloquence\Builder |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | * Get the relation constraint closure. |
| 351 | 351 | * |
| 352 | 352 | * @param string $method |
| 353 | - * @param \Sofa\Eloquence\ArgumentBag $args |
|
| 353 | + * @param ArgumentBag $args |
|
| 354 | 354 | * @return \Closure |
| 355 | 355 | */ |
| 356 | 356 | protected function getMappedWhereConstraint($method, 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) |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | * Determine the operator for count relation query and set 'not' appropriately. |
| 380 | 380 | * |
| 381 | 381 | * @param string $method |
| 382 | - * @param \Sofa\Eloquence\ArgumentBag $args |
|
| 382 | + * @param ArgumentBag $args |
|
| 383 | 383 | * @return string |
| 384 | 384 | */ |
| 385 | 385 | protected function getMappedOperator($method, 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 | { |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | protected function mappedSelectListsKey(Builder $query, $key) |
| 210 | 210 | { |
| 211 | 211 | if ($this->hasColumn($key)) { |
| 212 | - return $query->addSelect($this->getTable().'.'.$key); |
|
| 212 | + return $query->addSelect($this->getTable() . '.' . $key); |
|
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | return $query->addSelect($key); |
@@ -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 | } |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | $this->parseMappings(); |
| 432 | 432 | } |
| 433 | 433 | |
| 434 | - return array_key_exists((string)$key, static::$mappedAttributes); |
|
| 434 | + return array_key_exists((string) $key, static::$mappedAttributes); |
|
| 435 | 435 | } |
| 436 | 436 | |
| 437 | 437 | /** |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | * |
| 65 | 65 | * @param \Sofa\Eloquence\Builder $query |
| 66 | 66 | * @param string $method |
| 67 | - * @param \Sofa\Eloquence\ArgumentBag $args |
|
| 67 | + * @param ArgumentBag $args |
|
| 68 | 68 | * @return mixed |
| 69 | 69 | */ |
| 70 | 70 | protected function metaQuery(Builder $query, $method, ArgumentBag $args) |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * Adjust meta columns for select statement. |
| 81 | 81 | * |
| 82 | 82 | * @param \Sofa\Eloquence\Builder $query |
| 83 | - * @param \Sofa\Eloquence\ArgumentBag $args |
|
| 83 | + * @param ArgumentBag $args |
|
| 84 | 84 | * @return void |
| 85 | 85 | */ |
| 86 | 86 | protected function metaSelect(Builder $query, ArgumentBag $args) |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | * |
| 114 | 114 | * @param \Sofa\Eloquence\Builder $query |
| 115 | 115 | * @param string $method |
| 116 | - * @param \Sofa\Eloquence\ArgumentBag $args |
|
| 116 | + * @param ArgumentBag $args |
|
| 117 | 117 | * @return mixed |
| 118 | 118 | */ |
| 119 | 119 | protected function metaJoinQuery(Builder $query, $method, ArgumentBag $args) |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | * Get an array with the values of given meta attribute. |
| 149 | 149 | * |
| 150 | 150 | * @param \Sofa\Eloquence\Builder $query |
| 151 | - * @param \Sofa\Eloquence\ArgumentBag $args |
|
| 151 | + * @param ArgumentBag $args |
|
| 152 | 152 | * @param string $alias |
| 153 | 153 | * @return array |
| 154 | 154 | */ |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | * |
| 239 | 239 | * @param \Sofa\Eloquence\Builder $query |
| 240 | 240 | * @param string $method |
| 241 | - * @param \Sofa\Eloquence\ArgumentBag $args |
|
| 241 | + * @param ArgumentBag $args |
|
| 242 | 242 | * @return \Sofa\Eloquence\Builder |
| 243 | 243 | */ |
| 244 | 244 | protected function metaHasQuery(Builder $query, $method, ArgumentBag $args) |
@@ -259,7 +259,7 @@ discard block |
||
| 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) |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | * Determine the operator for count relation query. |
| 276 | 276 | * |
| 277 | 277 | * @param string $method |
| 278 | - * @param \Sofa\Eloquence\ArgumentBag $args |
|
| 278 | + * @param ArgumentBag $args |
|
| 279 | 279 | * @return string |
| 280 | 280 | */ |
| 281 | 281 | protected function getMetaOperator($method, ArgumentBag $args) |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | * Integers and floats must be passed in raw form in order to avoid string |
| 292 | 292 | * comparison, due to the fact that all meta values are stored as strings. |
| 293 | 293 | * |
| 294 | - * @param \Sofa\Eloquence\ArgumentBag $args |
|
| 294 | + * @param ArgumentBag $args |
|
| 295 | 295 | * @return void |
| 296 | 296 | */ |
| 297 | 297 | protected function unbindNumerics(ArgumentBag $args) |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | * Get the relation constraint closure. |
| 314 | 314 | * |
| 315 | 315 | * @param string $method |
| 316 | - * @param \Sofa\Eloquence\ArgumentBag $args |
|
| 316 | + * @param ArgumentBag $args |
|
| 317 | 317 | * @return \Closure |
| 318 | 318 | */ |
| 319 | 319 | protected function getMetaWhereConstraint($method, ArgumentBag $args) |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | if (strpos($key, '.') !== false) { |
| 178 | 178 | return $query->addSelect($key); |
| 179 | 179 | } elseif ($this->hasColumn($key)) { |
| 180 | - return $query->addSelect($this->getTable().'.'.$key); |
|
| 180 | + return $query->addSelect($this->getTable() . '.' . $key); |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | $alias = $this->joinMeta($query, $key); |
@@ -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); |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | */ |
| 231 | 231 | protected function generateMetaAlias() |
| 232 | 232 | { |
| 233 | - return md5(microtime(true)).'_meta_alias'; |
|
| 233 | + return md5(microtime(true)) . '_meta_alias'; |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | /** |
@@ -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); |
@@ -16,7 +16,6 @@ |
||
| 16 | 16 | * Mutate value using provided methods. |
| 17 | 17 | * |
| 18 | 18 | * @param mixed $value |
| 19 | - * @param string|array $mutators |
|
| 20 | 19 | * @return mixed |
| 21 | 20 | * |
| 22 | 21 | * @throws \LogicException |
@@ -264,7 +264,7 @@ |
||
| 264 | 264 | /** |
| 265 | 265 | * Get all validation rules for update for given id. |
| 266 | 266 | * |
| 267 | - * @param \Illuminate\Database\Eloquent\Model|string $id |
|
| 267 | + * @param Validable $id |
|
| 268 | 268 | * @return array |
| 269 | 269 | */ |
| 270 | 270 | public static function getUpdateRulesForId($id) |
@@ -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."); |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | */ |
| 130 | 130 | public function toArray() |
| 131 | 131 | { |
| 132 | - return array_map(function ($attribute) { |
|
| 132 | + return array_map(function($attribute) { |
|
| 133 | 133 | return $attribute->getValue(); |
| 134 | 134 | }, $this->items); |
| 135 | 135 | } |
@@ -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'); |