🔧
This commit is contained in:
@@ -26,11 +26,11 @@ class ChoiceQuestion extends Question
|
||||
private string $errorMessage = 'Value "%s" is invalid';
|
||||
|
||||
/**
|
||||
* @param string $question The question to ask to the user
|
||||
* @param array $choices The list of available choices
|
||||
* @param mixed $default The default answer to return
|
||||
* @param string $question The question to ask to the user
|
||||
* @param array $choices The list of available choices
|
||||
* @param string|bool|int|float|null $default The default answer to return
|
||||
*/
|
||||
public function __construct(string $question, array $choices, mixed $default = null)
|
||||
public function __construct(string $question, array $choices, string|bool|int|float|null $default = null)
|
||||
{
|
||||
if (!$choices) {
|
||||
throw new \LogicException('Choice question must have at least 1 choice available.');
|
||||
|
||||
6
vendor/symfony/console/Question/Question.php
vendored
6
vendor/symfony/console/Question/Question.php
vendored
@@ -36,7 +36,7 @@ class Question
|
||||
* @param string $question The question to ask to the user
|
||||
* @param string|bool|int|float|null $default The default answer to return if the user enters nothing
|
||||
*/
|
||||
public function __construct(string $question, string|bool|int|float $default = null)
|
||||
public function __construct(string $question, string|bool|int|float|null $default = null)
|
||||
{
|
||||
$this->question = $question;
|
||||
$this->default = $default;
|
||||
@@ -175,7 +175,7 @@ class Question
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAutocompleterCallback(callable $callback = null): static
|
||||
public function setAutocompleterCallback(?callable $callback = null): static
|
||||
{
|
||||
if (1 > \func_num_args()) {
|
||||
trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
@@ -194,7 +194,7 @@ class Question
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValidator(callable $validator = null): static
|
||||
public function setValidator(?callable $validator = null): static
|
||||
{
|
||||
if (1 > \func_num_args()) {
|
||||
trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
|
||||
Reference in New Issue
Block a user