public function formatOptionsArray($options) : array
    {

        //no transformations on grouped data
        if ($this->isGrouped()) {
            return $options;
        }


        if (! is_array($options) && ! count($options)) {
            return $options;
        }

        if (! isset($options[0]['value'])) {
            $ret = [];
            foreach ($options as $value => $text) {
                $ret[] = [
                    'value' => $value,
                    'text'  => $text,
                    ];
            }

            return $ret;
        }

        return $options;
    }
public function formatOptionsArray($options) : array
    {

        //no transformations on grouped data
        if ($this->isGrouped()) {
            return $options;
        }


        if (! is_array($options) && ! count($options)) {
            return $options;
        }

        if (! isset($options[0]['value'])) {
            $ret = [];
            foreach ($options as $value => $text) {
                $ret[] = [
                    'value' => $value,
                    'text'  => $text,
                    ];
            }

            return $ret;
        }

        return $options;
    }
public function formatOptionsArray ( $ options ) : array { //no transformations on grouped data if ( $ this -> isGrouped ( ) ) { return $ options ; } if ( ! is_array ( $ options ) && ! count ( $ options ) ) { return $ options ; } if ( ! isset ( $ options [ 0 ] [ 'value' ] ) ) { $ ret = [ ] ; foreach ( $ options as $ value => $ text ) { $ ret [ ] = [ 'value' => $ value , 'text' => $ text , ] ; } return $ ret ; } return $ options ; }
Thus method is used to ensure the correct format
of options array.

The selectOptionsXyz method can give arrays as $k=>$v
But we need them in
['value'=>$k, 'text'=>$v]
This method converts such arrays to the correct full format


@param array $options

@return array
Thus method is used to ensure the correct format of options array .