Skip to content

Commit 2f0e66c

Browse files
More docblock fixes
1 parent 9519592 commit 2f0e66c

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

FormFieldRegistry.php

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ public function set($name, $value)
121121
if ((!\is_array($value) && $target instanceof Field\FormField) || $target instanceof Field\ChoiceFormField) {
122122
$target->setValue($value);
123123
} 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) {
126128
$this->set($k, $v);
127129
}
128130
} else {
@@ -140,26 +142,6 @@ public function all()
140142
return $this->walk($this->fields, $this->base);
141143
}
142144

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-
163145
/**
164146
* Transforms a PHP array in a list of fully qualified name / value.
165147
*

0 commit comments

Comments
 (0)