update patch 1
This commit is contained in:
+3
-3
@@ -121,7 +121,7 @@ class ChoiceQuestion extends Question
|
||||
if ($multiselect) {
|
||||
// Check for a separated comma values
|
||||
if (!preg_match('/^[^,]+(?:,[^,]+)*$/', (string) $selected, $matches)) {
|
||||
throw new InvalidArgumentException(sprintf($errorMessage, $selected));
|
||||
throw new InvalidArgumentException(\sprintf($errorMessage, $selected));
|
||||
}
|
||||
|
||||
$selectedChoices = explode(',', (string) $selected);
|
||||
@@ -145,7 +145,7 @@ class ChoiceQuestion extends Question
|
||||
}
|
||||
|
||||
if (\count($results) > 1) {
|
||||
throw new InvalidArgumentException(sprintf('The provided answer is ambiguous. Value should be one of "%s".', implode('" or "', $results)));
|
||||
throw new InvalidArgumentException(\sprintf('The provided answer is ambiguous. Value should be one of "%s".', implode('" or "', $results)));
|
||||
}
|
||||
|
||||
$result = array_search($value, $choices);
|
||||
@@ -161,7 +161,7 @@ class ChoiceQuestion extends Question
|
||||
}
|
||||
|
||||
if (false === $result) {
|
||||
throw new InvalidArgumentException(sprintf($errorMessage, $value));
|
||||
throw new InvalidArgumentException(\sprintf($errorMessage, $value));
|
||||
}
|
||||
|
||||
// For associative choices, consistently return the key as string:
|
||||
|
||||
Reference in New Issue
Block a user