@@ -121,8 +121,10 @@ public function set($name, $value)
121
121
if ((!\is_array ($ value ) && $ target instanceof Field \FormField) || $ target instanceof Field \ChoiceFormField) {
122
122
$ target ->setValue ($ value );
123
123
} elseif (\is_array ($ value )) {
124
- $ fields = self ::create ($ name , $ value );
125
- foreach ($ fields ->all () as $ k => $ v ) {
124
+ $ registry = new static ();
125
+ $ registry ->base = $ name ;
126
+ $ registry ->fields = $ value ;
127
+ foreach ($ registry ->all () as $ k => $ v ) {
126
128
$ this ->set ($ k , $ v );
127
129
}
128
130
} else {
@@ -140,26 +142,6 @@ public function all()
140
142
return $ this ->walk ($ this ->fields , $ this ->base );
141
143
}
142
144
143
- /**
144
- * Creates an instance of the class.
145
- *
146
- * This function is made private because it allows overriding the $base and
147
- * the $values properties without any type checking.
148
- *
149
- * @param string $base The fully qualified name of the base field
150
- * @param array $values The values of the fields
151
- *
152
- * @return static
153
- */
154
- private static function create ($ base , array $ values )
155
- {
156
- $ registry = new static ();
157
- $ registry ->base = $ base ;
158
- $ registry ->fields = $ values ;
159
-
160
- return $ registry ;
161
- }
162
-
163
145
/**
164
146
* Transforms a PHP array in a list of fully qualified name / value.
165
147
*
0 commit comments