protected function listOptions(array $choices, $default = null, bool $multi = false): self
    {
        if (!$this->isAssocChoice($choices)) {
            return $this->promptOptions($choices, $default);
        }

        $maxLen = \max(\array_map('strlen', \array_keys($choices)));

        foreach ($choices as $choice => $desc) {
            $this->writer->eol()->cyan(\str_pad("  [$choice]", $maxLen + 6))->comment($desc);
        }

        $label = $multi ? 'Choices (comma separated)' : 'Choice';

        $this->writer->eol()->yellow($label);

        return $this->promptOptions(\array_keys($choices), $default);
    }
protected function listOptions(array $choices, $default = null, bool $multi = false): self
    {
        if (!$this->isAssocChoice($choices)) {
            return $this->promptOptions($choices, $default);
        }

        $maxLen = \max(\array_map('strlen', \array_keys($choices)));

        foreach ($choices as $choice => $desc) {
            $this->writer->eol()->cyan(\str_pad("  [$choice]", $maxLen + 6))->comment($desc);
        }

        $label = $multi ? 'Choices (comma separated)' : 'Choice';

        $this->writer->eol()->yellow($label);

        return $this->promptOptions(\array_keys($choices), $default);
    }
protected function listOptions ( array $ choices , $ default = null , bool $ multi = false ) : self { if ( ! $ this -> isAssocChoice ( $ choices ) ) { return $ this -> promptOptions ( $ choices , $ default ) ; } $ maxLen = \ max ( \ array_map ( 'strlen' , \ array_keys ( $ choices ) ) ) ; foreach ( $ choices as $ choice => $ desc ) { $ this -> writer -> eol ( ) -> cyan ( \ str_pad ( "  [$choice]" , $ maxLen + 6 ) ) -> comment ( $ desc ) ; } $ label = $ multi ? 'Choices (comma separated)' : 'Choice' ; $ this -> writer -> eol ( ) -> yellow ( $ label ) ; return $ this -> promptOptions ( \ array_keys ( $ choices ) , $ default ) ; }
Show choices list.

@param array $choices Available choices.
@param mixed $default
@param bool  $multi   Indicates multiple choices.

@return self
Show choices list .