src/Forms/Fields/Types/ChoiceType.php
public function getOptions(array $excludes = null): array
    {
        $options = parent::getOptions($excludes);

        /*
         * Let's add the choices in a readable format as
         * well as the layout property.
         */
        $choices = $this->getOption('choices', []);

        if ($choices instanceof ChoiceListInterface) {
            $choices = $choices->format()->get();
        }

        return array_merge($options, [
            'choices' => $choices,
            'layout' => $this->getLayout()
        ]);
    }
public function getOptions(array $excludes = null): array
    {
        $options = parent::getOptions($excludes);

        /*
         * Let's add the choices in a readable format as
         * well as the layout property.
         */
        $choices = $this->getOption('choices', []);

        if ($choices instanceof ChoiceListInterface) {
            $choices = $choices->format()->get();
        }

        return array_merge($options, [
            'choices' => $choices,
            'layout' => $this->getLayout()
        ]);
    }
public function getOptions ( array $ excludes = null ) : array { $ options = parent :: getOptions ( $ excludes ) ; /*
         * Let's add the choices in a readable format as
         * well as the layout property.
         */ $ choices = $ this -> getOption ( 'choices' , [ ] ) ; if ( $ choices instanceof ChoiceListInterface ) { $ choices = $ choices -> format ( ) -> get ( ) ; } return array_merge ( $ options , [ 'choices' => $ choices , 'layout' => $ this -> getLayout ( ) ] ) ; }
Return choice type field options.

@param array|null $excludes

@return array
Return choice type field options .