public function addOption(Option $option, string $optgroup = ''): Select
    {
        if (empty($optgroup)) {
            $this->options[] = $option;
        }
        else {
            $this->options[$optgroup][] = $option;
        }

        return $this;
    }
public function addOption(Option $option, string $optgroup = ''): Select
    {
        if (empty($optgroup)) {
            $this->options[] = $option;
        }
        else {
            $this->options[$optgroup][] = $option;
        }

        return $this;
    }
public function addOption ( Option $ option , string $ optgroup = '' ) : Select { if ( empty ( $ optgroup ) ) { $ this -> options [ ] = $ option ; } else { $ this -> options [ $ optgroup ] [ ] = $ option ; } return $ this ; }
Add an html option object to the optionlist

@param Option $option
@param string $optgroup
Related optgroup

@return Select
Add an html option object to the optionlist