Skip to content

Commit 3540f06

Browse files
Merge branch '5.4' into 6.3
* 5.4: Fix implicitly-required parameters List CS fix in .git-blame-ignore-revs Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value [Messenger][AmazonSqs] Allow async-aws/sqs version 2
2 parents 9aa3be6 + dbdf6ad commit 3540f06

38 files changed

+68
-68
lines changed

Application.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent)
142142
*
143143
* @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}.
144144
*/
145-
public function run(InputInterface $input = null, OutputInterface $output = null): int
145+
public function run(?InputInterface $input = null, ?OutputInterface $output = null): int
146146
{
147147
if (\function_exists('putenv')) {
148148
@putenv('LINES='.$this->terminal->getHeight());
@@ -783,7 +783,7 @@ public function find(string $name)
783783
*
784784
* @return Command[]
785785
*/
786-
public function all(string $namespace = null)
786+
public function all(?string $namespace = null)
787787
{
788788
$this->init();
789789

@@ -1162,7 +1162,7 @@ private function getAbbreviationSuggestions(array $abbrevs): string
11621162
*
11631163
* This method is not part of public API and should not be used directly.
11641164
*/
1165-
public function extractNamespace(string $name, int $limit = null): string
1165+
public function extractNamespace(string $name, ?int $limit = null): string
11661166
{
11671167
$parts = explode(':', $name, -1);
11681168

CI/GithubActionReporter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static function isGithubActionEnvironment(): bool
5757
*
5858
* @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-error-message
5959
*/
60-
public function error(string $message, string $file = null, int $line = null, int $col = null): void
60+
public function error(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void
6161
{
6262
$this->log('error', $message, $file, $line, $col);
6363
}
@@ -67,7 +67,7 @@ public function error(string $message, string $file = null, int $line = null, in
6767
*
6868
* @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message
6969
*/
70-
public function warning(string $message, string $file = null, int $line = null, int $col = null): void
70+
public function warning(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void
7171
{
7272
$this->log('warning', $message, $file, $line, $col);
7373
}
@@ -77,12 +77,12 @@ public function warning(string $message, string $file = null, int $line = null,
7777
*
7878
* @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-debug-message
7979
*/
80-
public function debug(string $message, string $file = null, int $line = null, int $col = null): void
80+
public function debug(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void
8181
{
8282
$this->log('debug', $message, $file, $line, $col);
8383
}
8484

85-
private function log(string $type, string $message, string $file = null, int $line = null, int $col = null): void
85+
private function log(string $type, string $message, ?string $file = null, ?int $line = null, ?int $col = null): void
8686
{
8787
// Some values must be encoded.
8888
$message = strtr($message, self::ESCAPED_DATA);

Command/Command.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public static function getDefaultDescription(): ?string
111111
*
112112
* @throws LogicException When the command name is empty
113113
*/
114-
public function __construct(string $name = null)
114+
public function __construct(?string $name = null)
115115
{
116116
$this->definition = new InputDefinition();
117117

@@ -152,7 +152,7 @@ public function ignoreValidationErrors()
152152
/**
153153
* @return void
154154
*/
155-
public function setApplication(Application $application = null)
155+
public function setApplication(?Application $application = null)
156156
{
157157
if (1 > \func_num_args()) {
158158
trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
@@ -460,7 +460,7 @@ public function getNativeDefinition(): InputDefinition
460460
*
461461
* @throws InvalidArgumentException When argument mode is not valid
462462
*/
463-
public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = null */): static
463+
public function addArgument(string $name, ?int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = null */): static
464464
{
465465
$suggestedValues = 5 <= \func_num_args() ? func_get_arg(4) : [];
466466
if (!\is_array($suggestedValues) && !$suggestedValues instanceof \Closure) {
@@ -484,7 +484,7 @@ public function addArgument(string $name, int $mode = null, string $description
484484
*
485485
* @throws InvalidArgumentException If option mode is invalid or incompatible
486486
*/
487-
public function addOption(string $name, string|array $shortcut = null, int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = [] */): static
487+
public function addOption(string $name, string|array|null $shortcut = null, ?int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = [] */): static
488488
{
489489
$suggestedValues = 6 <= \func_num_args() ? func_get_arg(5) : [];
490490
if (!\is_array($suggestedValues) && !$suggestedValues instanceof \Closure) {

Command/LazyCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function ignoreValidationErrors(): void
4545
$this->getCommand()->ignoreValidationErrors();
4646
}
4747

48-
public function setApplication(Application $application = null): void
48+
public function setApplication(?Application $application = null): void
4949
{
5050
if (1 > \func_num_args()) {
5151
trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
@@ -116,7 +116,7 @@ public function getNativeDefinition(): InputDefinition
116116
/**
117117
* @param array|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion
118118
*/
119-
public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = [] */): static
119+
public function addArgument(string $name, ?int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = [] */): static
120120
{
121121
$suggestedValues = 5 <= \func_num_args() ? func_get_arg(4) : [];
122122
$this->getCommand()->addArgument($name, $mode, $description, $default, $suggestedValues);
@@ -127,7 +127,7 @@ public function addArgument(string $name, int $mode = null, string $description
127127
/**
128128
* @param array|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion
129129
*/
130-
public function addOption(string $name, string|array $shortcut = null, int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = [] */): static
130+
public function addOption(string $name, string|array|null $shortcut = null, ?int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = [] */): static
131131
{
132132
$suggestedValues = 6 <= \func_num_args() ? func_get_arg(5) : [];
133133
$this->getCommand()->addOption($name, $shortcut, $mode, $description, $default, $suggestedValues);

Command/LockableTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ trait LockableTrait
2929
/**
3030
* Locks a command.
3131
*/
32-
private function lock(string $name = null, bool $blocking = false): bool
32+
private function lock(?string $name = null, bool $blocking = false): bool
3333
{
3434
if (!class_exists(SemaphoreStore::class)) {
3535
throw new LogicException('To enable the locking feature you must install the symfony/lock component. Try running "composer require symfony/lock".');

Descriptor/ApplicationDescription.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ApplicationDescription
3939
*/
4040
private array $aliases = [];
4141

42-
public function __construct(Application $application, string $namespace = null, bool $showHidden = false)
42+
public function __construct(Application $application, ?string $namespace = null, bool $showHidden = false)
4343
{
4444
$this->application = $application;
4545
$this->namespace = $namespace;

Descriptor/XmlDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function getCommandDocument(Command $command, bool $short = false): \DOMD
7979
return $dom;
8080
}
8181

82-
public function getApplicationDocument(Application $application, string $namespace = null, bool $short = false): \DOMDocument
82+
public function getApplicationDocument(Application $application, ?string $namespace = null, bool $short = false): \DOMDocument
8383
{
8484
$dom = new \DOMDocument('1.0', 'UTF-8');
8585
$dom->appendChild($rootXml = $dom->createElement('symfony'));

Event/ConsoleErrorEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class ConsoleErrorEvent extends ConsoleEvent
2525
private \Throwable $error;
2626
private int $exitCode;
2727

28-
public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, Command $command = null)
28+
public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, ?Command $command = null)
2929
{
3030
parent::__construct($command, $input, $output);
3131

EventListener/ErrorListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ErrorListener implements EventSubscriberInterface
2626
{
2727
private ?LoggerInterface $logger;
2828

29-
public function __construct(LoggerInterface $logger = null)
29+
public function __construct(?LoggerInterface $logger = null)
3030
{
3131
$this->logger = $logger;
3232
}

Exception/CommandNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class CommandNotFoundException extends \InvalidArgumentException implements Exce
2626
* @param int $code Exception code
2727
* @param \Throwable|null $previous Previous exception used for the exception chaining
2828
*/
29-
public function __construct(string $message, array $alternatives = [], int $code = 0, \Throwable $previous = null)
29+
public function __construct(string $message, array $alternatives = [], int $code = 0, ?\Throwable $previous = null)
3030
{
3131
parent::__construct($message, $code, $previous);
3232

0 commit comments

Comments
 (0)