upgraded dependencies
This commit is contained in:
@@ -58,11 +58,9 @@ class ChoiceQuestion extends Question
|
||||
*
|
||||
* When multiselect is set to true, multiple choices can be answered.
|
||||
*
|
||||
* @param bool $multiselect
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMultiselect($multiselect)
|
||||
public function setMultiselect(bool $multiselect)
|
||||
{
|
||||
$this->multiselect = $multiselect;
|
||||
$this->setValidator($this->getDefaultValidator());
|
||||
@@ -93,11 +91,9 @@ class ChoiceQuestion extends Question
|
||||
/**
|
||||
* Sets the prompt for choices.
|
||||
*
|
||||
* @param string $prompt
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPrompt($prompt)
|
||||
public function setPrompt(string $prompt)
|
||||
{
|
||||
$this->prompt = $prompt;
|
||||
|
||||
@@ -109,11 +105,9 @@ class ChoiceQuestion extends Question
|
||||
*
|
||||
* The error message has a string placeholder (%s) for the invalid value.
|
||||
*
|
||||
* @param string $errorMessage
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setErrorMessage($errorMessage)
|
||||
public function setErrorMessage(string $errorMessage)
|
||||
{
|
||||
$this->errorMessage = $errorMessage;
|
||||
$this->setValidator($this->getDefaultValidator());
|
||||
@@ -175,7 +169,8 @@ class ChoiceQuestion extends Question
|
||||
throw new InvalidArgumentException(sprintf($errorMessage, $value));
|
||||
}
|
||||
|
||||
$multiselectChoices[] = (string) $result;
|
||||
// For associative choices, consistently return the key as string:
|
||||
$multiselectChoices[] = $isAssoc ? (string) $result : $result;
|
||||
}
|
||||
|
||||
if ($multiselect) {
|
||||
|
Reference in New Issue
Block a user