protected static function extractAllowedValues($string, $has_data) {
    $values = [];

    $list = explode("\n", $string);
    $list = array_map('trim', $list);
    $list = array_filter($list, 'strlen');

    foreach ($list as $position => $text) {
      // Check for an explicit key.
      $matches = [];
      // @TODO Explicit key is necessary !
      if (preg_match('/(.*)\|(.*)\|(.*)/', $text, $matches)) {
        // Trim key and value to avoid unwanted spaces issues.
        $value = trim($matches[1]);
        $label = trim($matches[2]);
        $description = trim($matches[3]);

        $values[$value] = [
          'value' => $value,
          'label' => $label,
          'description' => $description,
        ];
      }
      elseif (preg_match('/(.*)\|(.*)/', $text, $matches)) {
        // Trim key and value to avoid unwanted spaces issues.
        $value = trim($matches[1]);
        $label = trim($matches[2]);
        $values[$value] = [
          'value' => $value,
          'label' => $label,
        ];
      }
    }

    return $values;
  }