mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-17 12:23:46 +09:00
Updates to vendors etc
This commit is contained in:
25
vendor/symfony/console/Question/Question.php
vendored
25
vendor/symfony/console/Question/Question.php
vendored
@@ -21,13 +21,11 @@ use Symfony\Component\Console\Exception\LogicException;
|
||||
*/
|
||||
class Question
|
||||
{
|
||||
private string $question;
|
||||
private ?int $attempts = null;
|
||||
private bool $hidden = false;
|
||||
private bool $hiddenFallback = true;
|
||||
private ?\Closure $autocompleterCallback = null;
|
||||
private ?\Closure $validator = null;
|
||||
private string|int|bool|null|float $default;
|
||||
private ?\Closure $normalizer = null;
|
||||
private bool $trimmable = true;
|
||||
private bool $multiline = false;
|
||||
@@ -36,10 +34,10 @@ 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|null $default = null)
|
||||
{
|
||||
$this->question = $question;
|
||||
$this->default = $default;
|
||||
public function __construct(
|
||||
private string $question,
|
||||
private string|bool|int|float|null $default = null,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -175,11 +173,8 @@ class Question
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAutocompleterCallback(?callable $callback = null): static
|
||||
public function setAutocompleterCallback(?callable $callback): static
|
||||
{
|
||||
if (1 > \func_num_args()) {
|
||||
trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
}
|
||||
if ($this->hidden && null !== $callback) {
|
||||
throw new LogicException('A hidden question cannot use the autocompleter.');
|
||||
}
|
||||
@@ -194,11 +189,8 @@ class Question
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValidator(?callable $validator = null): static
|
||||
public function setValidator(?callable $validator): static
|
||||
{
|
||||
if (1 > \func_num_args()) {
|
||||
trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
}
|
||||
$this->validator = null === $validator ? null : $validator(...);
|
||||
|
||||
return $this;
|
||||
@@ -266,10 +258,7 @@ class Question
|
||||
return $this->normalizer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
protected function isAssoc(array $array)
|
||||
protected function isAssoc(array $array): bool
|
||||
{
|
||||
return (bool) \count(array_filter(array_keys($array), 'is_string'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user