Conditions | 5 |
Paths | 4 |
Total Lines | 24 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public function processNext(EditableFormField $field) |
||
33 | { |
||
34 | // When we find a step, bubble up to the top |
||
35 | if ($field instanceof EditableFormStep) { |
||
36 | return $this->getParent()->processNext($field); |
||
37 | } |
||
38 | |||
39 | // Skip over fields that don't generate formfields |
||
40 | if (get_class($field) === EditableFormField::class || !$field->getFormField()) { |
||
41 | return $this; |
||
|
|||
42 | } |
||
43 | /** @var EditableFormField $formField */ |
||
44 | $formField = $field->getFormField(); |
||
45 | |||
46 | // Save this field |
||
47 | $this->push($formField); |
||
48 | |||
49 | // Nest fields that are containers |
||
50 | if ($formField instanceof UserFormsFieldContainer) { |
||
51 | return $formField->setParent($this); |
||
52 | } |
||
53 | |||
54 | // Add any subsequent fields to this |
||
55 | return $this; |
||
56 | } |
||
58 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: