| Conditions | 1 |
| Paths | 1 |
| Total Lines | 8 |
| Code Lines | 3 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | function addOptionsToComponent($data, $componentName) |
||
| 15 | { |
||
| 16 | // get fields for this component |
||
| 17 | $options = array_reduce(array_keys(Options::OPTION_TYPES), function ($carry, $optionType) use ($componentName) { |
||
| 18 | return array_merge($carry, Options::get($optionType, $componentName)); |
||
|
|
|||
| 19 | }, []); |
||
| 20 | // don't overwrite existing data |
||
| 21 | return array_merge($options, $data); |
||
| 22 | } |
||
| 23 |