| Conditions | 4 | 
| Paths | 6 | 
| Total Lines | 15 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php | ||
| 13 |   public function expand($values) { | ||
| 14 | $return = []; | ||
| 15 | $allowed_values = $this->fieldInfo['settings']['allowed_values']; | ||
| 16 | // If values are blank then use keys as value. | ||
| 17 |     foreach ($allowed_values as $key => $value) { | ||
| 18 |       if ($value == '') { | ||
| 19 | $allowed_values[$key] = $key; | ||
| 20 | } | ||
| 21 | } | ||
| 22 | $allowed_values = array_flip($allowed_values); | ||
| 23 |     foreach ($values as $value) { | ||
| 24 | $return[$this->language][] = ['value' => $allowed_values[$value]]; | ||
| 25 | } | ||
| 26 | return $return; | ||
| 27 | } | ||
| 28 | |||
| 30 |