mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-02 13:09:53 +09:00
update to laravel 5.7 and try getting autologin saved
This commit is contained in:
@@ -30,7 +30,7 @@ class ChoiceQuestion extends Question
|
||||
* @param array $choices The list of available choices
|
||||
* @param mixed $default The default answer to return
|
||||
*/
|
||||
public function __construct($question, array $choices, $default = null)
|
||||
public function __construct(string $question, array $choices, $default = null)
|
||||
{
|
||||
if (!$choices) {
|
||||
throw new \LogicException('Choice question must have at least 1 choice available.');
|
||||
@@ -121,12 +121,7 @@ class ChoiceQuestion extends Question
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the default answer validator.
|
||||
*
|
||||
* @return callable
|
||||
*/
|
||||
private function getDefaultValidator()
|
||||
private function getDefaultValidator(): callable
|
||||
{
|
||||
$choices = $this->choices;
|
||||
$errorMessage = $this->errorMessage;
|
||||
@@ -156,7 +151,7 @@ class ChoiceQuestion extends Question
|
||||
}
|
||||
}
|
||||
|
||||
if (count($results) > 1) {
|
||||
if (\count($results) > 1) {
|
||||
throw new InvalidArgumentException(sprintf('The provided answer is ambiguous. Value should be one of %s.', implode(' or ', $results)));
|
||||
}
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@ class ConfirmationQuestion extends Question
|
||||
* @param bool $default The default answer to return, true or false
|
||||
* @param string $trueAnswerRegex A regex to match the "yes" answer
|
||||
*/
|
||||
public function __construct($question, $default = true, $trueAnswerRegex = '/^y/i')
|
||||
public function __construct(string $question, bool $default = true, string $trueAnswerRegex = '/^y/i')
|
||||
{
|
||||
parent::__construct($question, (bool) $default);
|
||||
parent::__construct($question, $default);
|
||||
|
||||
$this->trueAnswerRegex = $trueAnswerRegex;
|
||||
$this->setNormalizer($this->getDefaultNormalizer());
|
||||
@@ -44,7 +44,7 @@ class ConfirmationQuestion extends Question
|
||||
$regex = $this->trueAnswerRegex;
|
||||
|
||||
return function ($answer) use ($default, $regex) {
|
||||
if (is_bool($answer)) {
|
||||
if (\is_bool($answer)) {
|
||||
return $answer;
|
||||
}
|
||||
|
||||
|
||||
20
vendor/symfony/console/Question/Question.php
vendored
20
vendor/symfony/console/Question/Question.php
vendored
@@ -34,7 +34,7 @@ class Question
|
||||
* @param string $question The question to ask to the user
|
||||
* @param mixed $default The default answer to return if the user enters nothing
|
||||
*/
|
||||
public function __construct($question, $default = null)
|
||||
public function __construct(string $question, $default = null)
|
||||
{
|
||||
$this->question = $question;
|
||||
$this->default = $default;
|
||||
@@ -117,7 +117,7 @@ class Question
|
||||
/**
|
||||
* Gets values for the autocompleter.
|
||||
*
|
||||
* @return null|iterable
|
||||
* @return iterable|null
|
||||
*/
|
||||
public function getAutocompleterValues()
|
||||
{
|
||||
@@ -127,7 +127,7 @@ class Question
|
||||
/**
|
||||
* Sets values for the autocompleter.
|
||||
*
|
||||
* @param null|iterable $values
|
||||
* @param iterable|null $values
|
||||
*
|
||||
* @return $this
|
||||
*
|
||||
@@ -136,11 +136,11 @@ class Question
|
||||
*/
|
||||
public function setAutocompleterValues($values)
|
||||
{
|
||||
if (is_array($values)) {
|
||||
if (\is_array($values)) {
|
||||
$values = $this->isAssoc($values) ? array_merge(array_keys($values), array_values($values)) : array_values($values);
|
||||
}
|
||||
|
||||
if (null !== $values && !is_array($values) && !$values instanceof \Traversable) {
|
||||
if (null !== $values && !\is_array($values) && !$values instanceof \Traversable) {
|
||||
throw new InvalidArgumentException('Autocompleter values can be either an array, `null` or a `Traversable` object.');
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ class Question
|
||||
/**
|
||||
* Sets a validator for the question.
|
||||
*
|
||||
* @param null|callable $validator
|
||||
* @param callable|null $validator
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@@ -170,7 +170,7 @@ class Question
|
||||
/**
|
||||
* Gets the validator for the question.
|
||||
*
|
||||
* @return null|callable
|
||||
* @return callable|null
|
||||
*/
|
||||
public function getValidator()
|
||||
{
|
||||
@@ -182,7 +182,7 @@ class Question
|
||||
*
|
||||
* Null means an unlimited number of attempts.
|
||||
*
|
||||
* @param null|int $attempts
|
||||
* @param int|null $attempts
|
||||
*
|
||||
* @return $this
|
||||
*
|
||||
@@ -204,7 +204,7 @@ class Question
|
||||
*
|
||||
* Null means an unlimited number of attempts.
|
||||
*
|
||||
* @return null|int
|
||||
* @return int|null
|
||||
*/
|
||||
public function getMaxAttempts()
|
||||
{
|
||||
@@ -241,6 +241,6 @@ class Question
|
||||
|
||||
protected function isAssoc($array)
|
||||
{
|
||||
return (bool) count(array_filter(array_keys($array), 'is_string'));
|
||||
return (bool) \count(array_filter(array_keys($array), 'is_string'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user