N°6934 - Symfony 6.4 - upgrade Symfony bundles to 6.4 (#580)

* Update Symfony lib to version ~6.4.0
* Update code missing return type
* Add an iTop general configuration entry to store application secret (Symfony mandatory parameter)
* Use dependency injection in ExceptionListener & UserProvider classes
This commit is contained in:
bdalsass
2023-12-05 13:56:56 +01:00
committed by GitHub
parent 863ab4560c
commit 27ce51ab07
1392 changed files with 44869 additions and 27799 deletions

View File

@@ -20,17 +20,17 @@ use Symfony\Component\Console\Exception\InvalidArgumentException;
*/
class ChoiceQuestion extends Question
{
private $choices;
private $multiselect = false;
private $prompt = ' > ';
private $errorMessage = 'Value "%s" is invalid';
private array $choices;
private bool $multiselect = false;
private string $prompt = ' > ';
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
*/
public function __construct(string $question, array $choices, $default = null)
public function __construct(string $question, array $choices, mixed $default = null)
{
if (!$choices) {
throw new \LogicException('Choice question must have at least 1 choice available.');
@@ -45,10 +45,8 @@ class ChoiceQuestion extends Question
/**
* Returns available choices.
*
* @return array
*/
public function getChoices()
public function getChoices(): array
{
return $this->choices;
}
@@ -60,7 +58,7 @@ class ChoiceQuestion extends Question
*
* @return $this
*/
public function setMultiselect(bool $multiselect)
public function setMultiselect(bool $multiselect): static
{
$this->multiselect = $multiselect;
$this->setValidator($this->getDefaultValidator());
@@ -70,20 +68,16 @@ class ChoiceQuestion extends Question
/**
* Returns whether the choices are multiselect.
*
* @return bool
*/
public function isMultiselect()
public function isMultiselect(): bool
{
return $this->multiselect;
}
/**
* Gets the prompt for choices.
*
* @return string
*/
public function getPrompt()
public function getPrompt(): string
{
return $this->prompt;
}
@@ -93,7 +87,7 @@ class ChoiceQuestion extends Question
*
* @return $this
*/
public function setPrompt(string $prompt)
public function setPrompt(string $prompt): static
{
$this->prompt = $prompt;
@@ -107,7 +101,7 @@ class ChoiceQuestion extends Question
*
* @return $this
*/
public function setErrorMessage(string $errorMessage)
public function setErrorMessage(string $errorMessage): static
{
$this->errorMessage = $errorMessage;
$this->setValidator($this->getDefaultValidator());