@@ -27,12 +27,12 @@ discard block |
||
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 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $args[2] = $id; |
46 | 46 | $args[3] = $primaryKey; |
47 | 47 | |
48 | - $rule = 'unique:'.implode(',', $args); |
|
48 | + $rule = 'unique:' . implode(',', $args); |
|
49 | 49 | }); |
50 | 50 | }); |
51 | 51 |
@@ -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 | } |
@@ -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."); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function toArray() |
149 | 149 | { |
150 | - return function ($next, $attributes) { |
|
150 | + return function($next, $attributes) { |
|
151 | 151 | $mappedAttributes = []; |
152 | 152 | foreach ($attributes as $column => $value) { |
153 | 153 | if ($key = $this->isMapping($column)) { |
@@ -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 | { |
@@ -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 | } |
@@ -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) |
@@ -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); |
@@ -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|integer|string $id |
|
267 | + * @param Validable $id |
|
268 | 268 | * @return array |
269 | 269 | */ |
270 | 270 | public static function getUpdateRulesForId($id) |