This commit is contained in:
2025-05-12 14:25:25 +02:00
parent ab2db755ef
commit 9e378ca2b7
2719 changed files with 46505 additions and 60181 deletions

View File

@@ -91,12 +91,12 @@ interface StyleInterface
/**
* Asks a question.
*/
public function ask(string $question, string $default = null, callable $validator = null): mixed;
public function ask(string $question, ?string $default = null, ?callable $validator = null): mixed;
/**
* Asks a question with the user input hidden.
*/
public function askHidden(string $question, callable $validator = null): mixed;
public function askHidden(string $question, ?callable $validator = null): mixed;
/**
* Asks for confirmation.

View File

@@ -63,7 +63,7 @@ class SymfonyStyle extends OutputStyle
*
* @return void
*/
public function block(string|array $messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true)
public function block(string|array $messages, ?string $type = null, ?string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true)
{
$messages = \is_array($messages) ? array_values($messages) : [$messages];
@@ -249,7 +249,7 @@ class SymfonyStyle extends OutputStyle
$this->horizontalTable($headers, [$row]);
}
public function ask(string $question, string $default = null, callable $validator = null): mixed
public function ask(string $question, ?string $default = null, ?callable $validator = null): mixed
{
$question = new Question($question, $default);
$question->setValidator($validator);
@@ -257,7 +257,7 @@ class SymfonyStyle extends OutputStyle
return $this->askQuestion($question);
}
public function askHidden(string $question, callable $validator = null): mixed
public function askHidden(string $question, ?callable $validator = null): mixed
{
$question = new Question($question);
@@ -336,7 +336,7 @@ class SymfonyStyle extends OutputStyle
*
* @return iterable<TKey, TValue>
*/
public function progressIterate(iterable $iterable, int $max = null): iterable
public function progressIterate(iterable $iterable, ?int $max = null): iterable
{
yield from $this->createProgressBar()->iterate($iterable, $max);
@@ -456,7 +456,7 @@ class SymfonyStyle extends OutputStyle
$this->bufferedOutput->write($message, $newLine, $type);
}
private function createBlock(iterable $messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false): array
private function createBlock(iterable $messages, ?string $type = null, ?string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false): array
{
$indentLength = 0;
$prefixLength = Helper::width(Helper::removeDecoration($this->getFormatter(), $prefix));