Skip to content

Commit e97c6d7

Browse files
Merge branch '4.3' into 4.4
* 4.3: More docblock fixes fix test
2 parents 4ba771b + 473d2f8 commit e97c6d7

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

FormFieldRegistry.php

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ public function set(string $name, $value)
114114
if ((!\is_array($value) && $target instanceof Field\FormField) || $target instanceof Field\ChoiceFormField) {
115115
$target->setValue($value);
116116
} 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) {
119121
$this->set($k, $v);
120122
}
121123
} else {
@@ -133,25 +135,6 @@ public function all(): array
133135
return $this->walk($this->fields, $this->base);
134136
}
135137

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-
155138
/**
156139
* Transforms a PHP array in a list of fully qualified name / value.
157140
*/

0 commit comments

Comments
 (0)