8000 Merge branch '6.3' into 6.4 · symfony/console@2aaf83b · GitHub
[go: up one dir, main page]

Skip to content

Commit 2aaf83b

Browse files
Merge branch '6.3' into 6.4
* 6.3: minor #53524 [Messenger] [AmazonSqs] Allow `async-aws/sqs` version 2 (smoench) Fix bad merge List CS fix in .git-blame-ignore-revs 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
2 parents 3068eac + 3540f06 commit 2aaf83b

39 files changed

+71
-71
lines changed

Application.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent)
143143
*
144144
* @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}.
145145
*/
146-
public function run(InputInterface $input = null, OutputInterface $output = null): int
146+
public function run(?InputInterface $input = null, ?OutputInterface $output = null): int
147147
{
148148
if (\function_exists('putenv')) {
149149
@putenv('LINES='.$this->terminal->getHeight());
@@ -795,7 +795,7 @@ public function find(string $name)
795795
*
796796
* @return Command[]
797797
*/
798-
public function all(string $namespace = null)
798+
public function all(?string $namespace = null)
799799
{
800800
$this->init();
801801

@@ -1177,7 +1177,7 @@ private function getAbbreviationSuggestions(array $abbrevs): string
11771177
*
11781178
* This method is not part of public API and should not be used directly.
11791179
*/
1180-
public function extractNamespace(string $name, int $limit = null): string
1180+
public function extractNamespace(string $name, ?int $limit = null): string
11811181
{
11821182
$parts = explode(':', $name, -1);
11831183

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".');

Command/TraceableCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function ignoreValidationErrors(): void
134134
parent::ignoreValidationErrors();
135135
}
136136

137-
public function setApplication(Application $application = null): void
137+
public function setApplication(?Application $application = null): void
138138
{
139139
$this->command->setApplication($application);
140140
}
@@ -209,14 +209,14 @@ public function getNativeDefinition(): InputDefinition
209209
return $this->command->getNativeDefinition();
210210
}
211211

212-
public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static
212+
public function addArgument(string $name, ?int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static
213213
{
214214
$this->command->addArgument($name, $mode, $description, $default, $suggestedValues);
215215

216216
return $this;
217217
}
218218

219-
public function addOption(string $name, string|array $shortcut = null, int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static
219+
public function addOption(string $name, string|array|null $shortcut = null, ?int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static
220220
{
221221
$this->command->addOption($name, $shortcut, $mode, $description, $default, $suggestedValues);
222222

DataCollector/CommandDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*/
2828
final class CommandDataCollector extends DataCollector
2929
{
30-
public function collect(Request $request, Response $response, \Throwable $exception = null): void
30+
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void
3131
{
3232
if (!$request instanceof CliRequest) {
3333
return;

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

0 commit comments

Comments
 (0)
0