| Conditions | 2 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 54 | public function response($input) { |
||
| 55 | return [ |
||
| 56 | 'label' => $this->label, |
||
| 57 | 'response' => $this->fields->map(function ($field) use ($input) { |
||
| 58 | |||
| 59 | // Handle empty radio buttons etc. sending nothing in POST request |
||
| 60 | if (!array_key_exists($field->name, $input)) { |
||
| 61 | $input[$field->name] = null; |
||
| 62 | } |
||
| 63 | |||
| 64 | |||
| 65 | return $field->response($input[$field->name]); |
||
| 66 | })->toArray(), |
||
| 67 | 'type' => $this->type, |
||
| 68 | ]; |
||
| 70 | } |