protected function getOptions() : array
    {
        $options = [];

        foreach ($this->elements as $element) {
            if ($element instanceof Option) {
                $options[] = $element;
            }
            elseif ($element instanceof OptionGroup) {
                $options = array_merge($options, $element->getOptions());
            }
        }

        return $options;
    }
protected function getOptions() : array
    {
        $options = [];

        foreach ($this->elements as $element) {
            if ($element instanceof Option) {
                $options[] = $element;
            }
            elseif ($element instanceof OptionGroup) {
                $options = array_merge($options, $element->getOptions());
            }
        }

        return $options;
    }
protected function getOptions ( ) : array { $ options = [ ] ; foreach ( $ this -> elements as $ element ) { if ( $ element instanceof Option ) { $ options [ ] = $ element ; } elseif ( $ element instanceof OptionGroup ) { $ options = array_merge ( $ options , $ element -> getOptions ( ) ) ; } } return $ options ; }
Returns all the options in this Select, including the ones nested in option groups.

@return Option[]
Returns all the options in this Select including the ones nested in option groups .