+ /**
+ * Build options for a drop-down box from a textual list.
+ *
+ * The result of this function can be passed to XmlSelect::addOptions()
+ * (to render a plain `<select>` dropdown box) or to Xml::listDropDownOptionsOoui()
+ * and then OOUI\DropdownInputWidget() (to render a pretty one).
+ *
+ * @param string $list Correctly formatted text (newline delimited) to be
+ * used to generate the options.
+ * @param array $params Extra parameters
+ * @param string $params['other'] If set, add an option with this as text and a value of 'other'
+ * @return array Array keys are textual labels, values are internal values
+ */
+ public static function listDropDownOptions( $list, $params = [] ) {
+ $options = [];
+
+ if ( isset( $params['other'] ) ) {
+ $options[ $params['other'] ] = 'other';
+ }
+
+ $optgroup = false;