@@ -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) |
@@ -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'); |
@@ -27,12 +27,12 @@ |
||
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 | } |
@@ -70,7 +70,7 @@ |
||
70 | 70 | |
71 | 71 | if ($this->alias) { |
72 | 72 | // check for "." in tableName replace with with "_" |
73 | - $sql .= ' as ' .$this->query->getGrammar()->wrapTable( |
|
73 | + $sql .= ' as '.$this->query->getGrammar()->wrapTable( |
|
74 | 74 | str_replace('.', '_', $this->alias) |
75 | 75 | ); |
76 | 76 | } |
@@ -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)) { |