Kanboard requires at least PHP 5.6 now
This commit is contained in:
30
vendor/symfony/console/Question/Question.php
vendored
30
vendor/symfony/console/Question/Question.php
vendored
@@ -31,8 +31,6 @@ class Question
|
||||
private $normalizer;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $question The question to ask to the user
|
||||
* @param mixed $default The default answer to return if the user enters nothing
|
||||
*/
|
||||
@@ -77,7 +75,7 @@ class Question
|
||||
*
|
||||
* @param bool $hidden
|
||||
*
|
||||
* @return Question The current instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws LogicException In case the autocompleter is also used
|
||||
*/
|
||||
@@ -107,7 +105,7 @@ class Question
|
||||
*
|
||||
* @param bool $fallback
|
||||
*
|
||||
* @return Question The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setHiddenFallback($fallback)
|
||||
{
|
||||
@@ -119,7 +117,7 @@ class Question
|
||||
/**
|
||||
* Gets values for the autocompleter.
|
||||
*
|
||||
* @return null|array|\Traversable
|
||||
* @return null|iterable
|
||||
*/
|
||||
public function getAutocompleterValues()
|
||||
{
|
||||
@@ -129,9 +127,9 @@ class Question
|
||||
/**
|
||||
* Sets values for the autocompleter.
|
||||
*
|
||||
* @param null|array|\Traversable $values
|
||||
* @param null|iterable $values
|
||||
*
|
||||
* @return Question The current instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @throws LogicException
|
||||
@@ -142,10 +140,8 @@ class Question
|
||||
$values = $this->isAssoc($values) ? array_merge(array_keys($values), array_values($values)) : array_values($values);
|
||||
}
|
||||
|
||||
if (null !== $values && !is_array($values)) {
|
||||
if (!$values instanceof \Traversable || !$values instanceof \Countable) {
|
||||
throw new InvalidArgumentException('Autocompleter values can be either an array, `null` or an object implementing both `Countable` and `Traversable` interfaces.');
|
||||
}
|
||||
if (null !== $values && !is_array($values) && !$values instanceof \Traversable) {
|
||||
throw new InvalidArgumentException('Autocompleter values can be either an array, `null` or a `Traversable` object.');
|
||||
}
|
||||
|
||||
if ($this->hidden) {
|
||||
@@ -162,9 +158,9 @@ class Question
|
||||
*
|
||||
* @param null|callable $validator
|
||||
*
|
||||
* @return Question The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setValidator($validator)
|
||||
public function setValidator(callable $validator = null)
|
||||
{
|
||||
$this->validator = $validator;
|
||||
|
||||
@@ -188,9 +184,9 @@ class Question
|
||||
*
|
||||
* @param null|int $attempts
|
||||
*
|
||||
* @return Question The current instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws InvalidArgumentException In case the number of attempts is invalid.
|
||||
* @throws InvalidArgumentException in case the number of attempts is invalid
|
||||
*/
|
||||
public function setMaxAttempts($attempts)
|
||||
{
|
||||
@@ -222,9 +218,9 @@ class Question
|
||||
*
|
||||
* @param callable $normalizer
|
||||
*
|
||||
* @return Question The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setNormalizer($normalizer)
|
||||
public function setNormalizer(callable $normalizer)
|
||||
{
|
||||
$this->normalizer = $normalizer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user