File tree Expand file tree Collapse file tree 1 file changed +4
-21
lines changed Expand file tree Collapse file tree 1 file changed +4
-21
lines changed Original file line number Diff line number Diff line change @@ -114,8 +114,10 @@ public function set(string $name, $value)
114
114
if ((!\is_array ($ value ) && $ target instanceof Field \FormField) || $ target instanceof Field \ChoiceFormField) {
115
115
$ target ->setValue ($ value );
116
116
} elseif (\is_array ($ value )) {
117
- $ fields = self ::create ($ name , $ value );
118
- foreach ($ fields ->all () as $ k => $ v ) {
117
+ $ registry = new static ();
118
+ $ registry ->base = $ name ;
119
+ $ registry ->fields = $ value ;
120
+ foreach ($ registry ->all () as $ k => $ v ) {
119
121
$ this ->set ($ k , $ v );
120
122
}
121
123
} else {
@@ -133,25 +135,6 @@ public function all(): array
133
135
return $ this ->walk ($ this ->fields , $ this ->base );
134
136
}
135
137
136
- /**
137
- * Creates an instance of the class.
138
- *
139
- * This function is made private because it allows overriding the $base and
140
- * the $values properties without any type checking.
141
- *
142
- * @param array $values The values of the fields
143
- *
144
- * @return static
145
- */
146
- private static function create (string $ base , array $ values )
147
- {
148
- $ registry = new static ();
149
- $ registry ->base = $ base ;
150
- $ registry ->fields = $ values ;
151
-
152
- return $ registry ;
153
- }
154
-
155
138
/**
156
139
* Transforms a PHP array in a list of fully qualified name / value.
157
140
*/
You can’t perform that action at this time.
0 commit comments