src/Forms/Fields/ChoiceList/ChoiceList.php
protected function parse(array $choices)
    {
        $items = [];

        foreach ($choices as $key => $value) {
            if (is_array($value)) {
                $items[$key] = $this->parse($value);
            } else {
                if (is_int($key)) {
                    $label = ucfirst(str_replace(['-', '_'], ' ', $value));
                } else {
                    $label = $key;
                }

                $items[$label] = $value;
            }
        }

        return $items;
    }
protected function parse(array $choices)
    {
        $items = [];

        foreach ($choices as $key => $value) {
            if (is_array($value)) {
                $items[$key] = $this->parse($value);
            } else {
                if (is_int($key)) {
                    $label = ucfirst(str_replace(['-', '_'], ' ', $value));
                } else {
                    $label = $key;
                }

                $items[$label] = $value;
            }
        }

        return $items;
    }
protected function parse ( array $ choices ) { $ items = [ ] ; foreach ( $ choices as $ key => $ value ) { if ( is_array ( $ value ) ) { $ items [ $ key ] = $ this -> parse ( $ value ) ; } else { if ( is_int ( $ key ) ) { $ label = ucfirst ( str_replace ( [ '-' , '_' ] , ' ' , $ value ) ) ; } else { $ label = $ key ; } $ items [ $ label ] = $ value ; } } return $ items ; }
Parse the choices and format them.

@param array $choices

@return array
Parse the choices and format them .