Skip to content

Commit

Permalink
Merge branch '6.4' into 7.0
Browse files Browse the repository at this point in the history
* 6.4:
  Fix implicitly-required parameters
  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
  [Messenger][AmazonSqs] Allow async-aws/sqs version 2
  • Loading branch information
nicolas-grekas committed Jan 23, 2024
2 parents 471ebf8 + 2aaf83b commit c5010d5
Show file tree
Hide file tree
Showing 38 changed files with 60 additions and 60 deletions.
6 changes: 3 additions & 3 deletions Application.php
Expand Up @@ -137,7 +137,7 @@ public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent): void
*
* @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}.
*/
public function run(InputInterface $input = null, OutputInterface $output = null): int
public function run(?InputInterface $input = null, ?OutputInterface $output = null): int
{
if (\function_exists('putenv')) {
@putenv('LINES='.$this->terminal->getHeight());
Expand Down Expand Up @@ -762,7 +762,7 @@ public function find(string $name): Command
*
* @return Command[]
*/
public function all(string $namespace = null): array
public function all(?string $namespace = null): array
{
$this->init();

Expand Down Expand Up @@ -1130,7 +1130,7 @@ private function getAbbreviationSuggestions(array $abbrevs): string
*
* This method is not part of public API and should not be used directly.
*/
public function extractNamespace(string $name, int $limit = null): string
public function extractNamespace(string $name, ?int $limit = null): string
{
$parts = explode(':', $name, -1);

Expand Down
8 changes: 4 additions & 4 deletions CI/GithubActionReporter.php
Expand Up @@ -57,7 +57,7 @@ public static function isGithubActionEnvironment(): bool
*
* @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-error-message
*/
public function error(string $message, string $file = null, int $line = null, int $col = null): void
public function error(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void
{
$this->log('error', $message, $file, $line, $col);
}
Expand All @@ -67,7 +67,7 @@ public function error(string $message, string $file = null, int $line = null, in
*
* @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message
*/
public function warning(string $message, string $file = null, int $line = null, int $col = null): void
public function warning(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void
{
$this->log('warning', $message, $file, $line, $col);
}
Expand All @@ -77,12 +77,12 @@ public function warning(string $message, string $file = null, int $line = null,
*
* @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-debug-message
*/
public function debug(string $message, string $file = null, int $line = null, int $col = null): void
public function debug(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void
{
$this->log('debug', $message, $file, $line, $col);
}

private function log(string $type, string $message, string $file = null, int $line = null, int $col = null): void
private function log(string $type, string $message, ?string $file = null, ?int $line = null, ?int $col = null): void
{
// Some values must be encoded.
$message = strtr($message, self::ESCAPED_DATA);
Expand Down
6 changes: 3 additions & 3 deletions Command/Command.php
Expand Up @@ -77,7 +77,7 @@ public static function getDefaultDescription(): ?string
*
* @throws LogicException When the command name is empty
*/
public function __construct(string $name = null)
public function __construct(?string $name = null)
{
$this->definition = new InputDefinition();

Expand Down Expand Up @@ -413,7 +413,7 @@ public function getNativeDefinition(): InputDefinition
*
* @throws InvalidArgumentException When argument mode is not valid
*/
public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static
public function addArgument(string $name, ?int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static
{
$this->definition->addArgument(new InputArgument($name, $mode, $description, $default, $suggestedValues));
$this->fullDefinition?->addArgument(new InputArgument($name, $mode, $description, $default, $suggestedValues));
Expand All @@ -433,7 +433,7 @@ public function addArgument(string $name, int $mode = null, string $description
*
* @throws InvalidArgumentException If option mode is invalid or incompatible
*/
public function addOption(string $name, string|array $shortcut = null, int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static
public function addOption(string $name, string|array|null $shortcut = null, ?int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static
{
$this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default, $suggestedValues));
$this->fullDefinition?->addOption(new InputOption($name, $shortcut, $mode, $description, $default, $suggestedValues));
Expand Down
4 changes: 2 additions & 2 deletions Command/LazyCommand.php
Expand Up @@ -113,7 +113,7 @@ public function getNativeDefinition(): InputDefinition
/**
* @param array|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion
*/
public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static
public function addArgument(string $name, ?int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static
{
$this->getCommand()->addArgument($name, $mode, $description, $default, $suggestedValues);

Expand All @@ -123,7 +123,7 @@ public function addArgument(string $name, int $mode = null, string $description
/**
* @param array|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion
*/
public function addOption(string $name, string|array $shortcut = null, int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static
public function addOption(string $name, string|array|null $shortcut = null, ?int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static
{
$this->getCommand()->addOption($name, $shortcut, $mode, $description, $default, $suggestedValues);

Expand Down
2 changes: 1 addition & 1 deletion Command/LockableTrait.php
Expand Up @@ -29,7 +29,7 @@ trait LockableTrait
/**
* Locks a command.
*/
private function lock(string $name = null, bool $blocking = false): bool
private function lock(?string $name = null, bool $blocking = false): bool
{
if (!class_exists(SemaphoreStore::class)) {
throw new LogicException('To enable the locking feature you must install the symfony/lock component. Try running "composer require symfony/lock".');
Expand Down
6 changes: 3 additions & 3 deletions Command/TraceableCommand.php
Expand Up @@ -134,7 +134,7 @@ public function ignoreValidationErrors(): void
parent::ignoreValidationErrors();
}

public function setApplication(Application $application = null): void
public function setApplication(?Application $application = null): void
{
$this->command->setApplication($application);
}
Expand Down Expand Up @@ -209,14 +209,14 @@ public function getNativeDefinition(): InputDefinition
return $this->command->getNativeDefinition();
}

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

return $this;
}

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

Expand Down
2 changes: 1 addition & 1 deletion DataCollector/CommandDataCollector.php
Expand Up @@ -27,7 +27,7 @@
*/
final class CommandDataCollector extends DataCollector
{
public function collect(Request $request, Response $response, \Throwable $exception = null): void
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void
{
if (!$request instanceof CliRequest) {
return;
Expand Down
2 changes: 1 addition & 1 deletion Descriptor/ApplicationDescription.php
Expand Up @@ -39,7 +39,7 @@ class ApplicationDescription
*/
private array $aliases = [];

public function __construct(Application $application, string $namespace = null, bool $showHidden = false)
public function __construct(Application $application, ?string $namespace = null, bool $showHidden = false)
{
$this->application = $application;
$this->namespace = $namespace;
Expand Down
2 changes: 1 addition & 1 deletion Descriptor/XmlDescriptor.php
Expand Up @@ -79,7 +79,7 @@ public function getCommandDocument(Command $command, bool $short = false): \DOMD
return $dom;
}

public function getApplicationDocument(Application $application, string $namespace = null, bool $short = false): \DOMDocument
public function getApplicationDocument(Application $application, ?string $namespace = null, bool $short = false): \DOMDocument
{
$dom = new \DOMDocument('1.0', 'UTF-8');
$dom->appendChild($rootXml = $dom->createElement('symfony'));
Expand Down
2 changes: 1 addition & 1 deletion Event/ConsoleErrorEvent.php
Expand Up @@ -25,7 +25,7 @@ final class ConsoleErrorEvent extends ConsoleEvent
private \Throwable $error;
private int $exitCode;

public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, Command $command = null)
public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, ?Command $command = null)
{
parent::__construct($command, $input, $output);

Expand Down
2 changes: 1 addition & 1 deletion EventListener/ErrorListener.php
Expand Up @@ -26,7 +26,7 @@ class ErrorListener implements EventSubscriberInterface
{
private ?LoggerInterface $logger;

public function __construct(LoggerInterface $logger = null)
public function __construct(?LoggerInterface $logger = null)
{
$this->logger = $logger;
}
Expand Down
2 changes: 1 addition & 1 deletion Exception/CommandNotFoundException.php
Expand Up @@ -26,7 +26,7 @@ class CommandNotFoundException extends \InvalidArgumentException implements Exce
* @param int $code Exception code
* @param \Throwable|null $previous Previous exception used for the exception chaining
*/
public function __construct(string $message, array $alternatives = [], int $code = 0, \Throwable $previous = null)
public function __construct(string $message, array $alternatives = [], int $code = 0, ?\Throwable $previous = null)
{
parent::__construct($message, $code, $previous);

Expand Down
2 changes: 1 addition & 1 deletion Formatter/OutputFormatterStyle.php
Expand Up @@ -33,7 +33,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
* @param string|null $foreground The style foreground color name
* @param string|null $background The style background color name
*/
public function __construct(string $foreground = null, string $background = null, array $options = [])
public function __construct(?string $foreground = null, ?string $background = null, array $options = [])
{
$this->color = new Color($this->foreground = $foreground ?: '', $this->background = $background ?: '', $this->options = $options);
}
Expand Down
4 changes: 2 additions & 2 deletions Formatter/OutputFormatterStyleStack.php
Expand Up @@ -26,7 +26,7 @@ class OutputFormatterStyleStack implements ResetInterface

private OutputFormatterStyleInterface $emptyStyle;

public function __construct(OutputFormatterStyleInterface $emptyStyle = null)
public function __construct(?OutputFormatterStyleInterface $emptyStyle = null)
{
$this->emptyStyle = $emptyStyle ?? new OutputFormatterStyle();
$this->reset();
Expand All @@ -53,7 +53,7 @@ public function push(OutputFormatterStyleInterface $style): void
*
* @throws InvalidArgumentException When style tags incorrectly nested
*/
public function pop(OutputFormatterStyleInterface $style = null): OutputFormatterStyleInterface
public function pop(?OutputFormatterStyleInterface $style = null): OutputFormatterStyleInterface
{
if (!$this->styles) {
return $this->emptyStyle;
Expand Down
2 changes: 1 addition & 1 deletion Helper/Dumper.php
Expand Up @@ -26,7 +26,7 @@ final class Dumper
private ?ClonerInterface $cloner;
private \Closure $handler;

public function __construct(OutputInterface $output, CliDumper $dumper = null, ClonerInterface $cloner = null)
public function __construct(OutputInterface $output, ?CliDumper $dumper = null, ?ClonerInterface $cloner = null)
{
$this->output = $output;
$this->dumper = $dumper;
Expand Down
2 changes: 1 addition & 1 deletion Helper/Helper.php
Expand Up @@ -74,7 +74,7 @@ public static function length(?string $string): int
/**
* Returns the subset of a string, using mb_substr if it is available.
*/
public static function substr(?string $string, int $from, int $length = null): string
public static function substr(?string $string, int $from, ?int $length = null): string
{
$string ??= '';

Expand Down
2 changes: 1 addition & 1 deletion Helper/HelperSet.php
Expand Up @@ -35,7 +35,7 @@ public function __construct(array $helpers = [])
}
}

public function set(HelperInterface $helper, string $alias = null): void
public function set(HelperInterface $helper, ?string $alias = null): void
{
$this->helpers[$helper->getName()] = $helper;
if (null !== $alias) {
Expand Down
6 changes: 3 additions & 3 deletions Helper/ProcessHelper.php
Expand Up @@ -32,7 +32,7 @@ class ProcessHelper extends Helper
* @param callable|null $callback A PHP callback to run whenever there is some
* output available on STDOUT or STDERR
*/
public function run(OutputInterface $output, array|Process $cmd, string $error = null, callable $callback = null, int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE): Process
public function run(OutputInterface $output, array|Process $cmd, ?string $error = null, ?callable $callback = null, int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE): Process
{
if (!class_exists(Process::class)) {
throw new \LogicException('The ProcessHelper cannot be run as the Process component is not installed. Try running "compose require symfony/process".');
Expand Down Expand Up @@ -94,7 +94,7 @@ public function run(OutputInterface $output, array|Process $cmd, string $error =
*
* @see run()
*/
public function mustRun(OutputInterface $output, array|Process $cmd, string $error = null, callable $callback = null): Process
public function mustRun(OutputInterface $output, array|Process $cmd, ?string $error = null, ?callable $callback = null): Process
{
$process = $this->run($output, $cmd, $error, $callback);

Expand All @@ -108,7 +108,7 @@ public function mustRun(OutputInterface $output, array|Process $cmd, string $err
/**
* Wraps a Process callback to add debugging output.
*/
public function wrapCallback(OutputInterface $output, Process $process, callable $callback = null): callable
public function wrapCallback(OutputInterface $output, Process $process, ?callable $callback = null): callable
{
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
Expand Down
4 changes: 2 additions & 2 deletions Helper/ProgressBar.php
Expand Up @@ -313,7 +313,7 @@ public function maxSecondsBetweenRedraws(float $seconds): void
*
* @return iterable<TKey, TValue>
*/
public function iterate(iterable $iterable, int $max = null): iterable
public function iterate(iterable $iterable, ?int $max = null): iterable
{
$this->start($max ?? (is_countable($iterable) ? \count($iterable) : 0));

Expand All @@ -332,7 +332,7 @@ public function iterate(iterable $iterable, int $max = null): iterable
* @param int|null $max Number of steps to complete the bar (0 if indeterminate), null to leave unchanged
* @param int $startAt The starting point of the bar (useful e.g. when resuming a previously started bar)
*/
public function start(int $max = null, int $startAt = 0): void
public function start(?int $max = null, int $startAt = 0): void
{
$this->startTime = time();
$this->step = $startAt;
Expand Down
2 changes: 1 addition & 1 deletion Helper/ProgressIndicator.php
Expand Up @@ -50,7 +50,7 @@ class ProgressIndicator
* @param int $indicatorChangeInterval Change interval in milliseconds
* @param array|null $indicatorValues Animated indicator characters
*/
public function __construct(OutputInterface $output, string $format = null, int $indicatorChangeInterval = 100, array $indicatorValues = null)
public function __construct(OutputInterface $output, ?string $format = null, int $indicatorChangeInterval = 100, ?array $indicatorValues = null)
{
$this->output = $output;

Expand Down
4 changes: 2 additions & 2 deletions Helper/Table.php
Expand Up @@ -462,7 +462,7 @@ public function render(): void
*
* +-----+-----------+-------+
*/
private function renderRowSeparator(int $type = self::SEPARATOR_MID, string $title = null, string $titleFormat = null): void
private function renderRowSeparator(int $type = self::SEPARATOR_MID, ?string $title = null, ?string $titleFormat = null): void
{
if (!$count = $this->numberOfColumns) {
return;
Expand Down Expand Up @@ -527,7 +527,7 @@ private function renderColumnSeparator(int $type = self::BORDER_OUTSIDE): string
*
* | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
*/
private function renderRow(array $row, string $cellFormat, string $firstCellFormat = null): void
private function renderRow(array $row, string $cellFormat, ?string $firstCellFormat = null): void
{
$rowContent = $this->renderColumnSeparator(self::BORDER_OUTSIDE);
$columns = $this->getRowColumns($row);
Expand Down
6 changes: 3 additions & 3 deletions Helper/TableStyle.php
Expand Up @@ -88,7 +88,7 @@ public function getPaddingChar(): string
*
* @return $this
*/
public function setHorizontalBorderChars(string $outside, string $inside = null): static
public function setHorizontalBorderChars(string $outside, ?string $inside = null): static
{
$this->horizontalOutsideBorderChar = $outside;
$this->horizontalInsideBorderChar = $inside ?? $outside;
Expand All @@ -113,7 +113,7 @@ public function setHorizontalBorderChars(string $outside, string $inside = null)
*
* @return $this
*/
public function setVerticalBorderChars(string $outside, string $inside = null): static
public function setVerticalBorderChars(string $outside, ?string $inside = null): static
{
$this->verticalOutsideBorderChar = $outside;
$this->verticalInsideBorderChar = $inside ?? $outside;
Expand Down Expand Up @@ -167,7 +167,7 @@ public function getBorderChars(): array
*
* @return $this
*/
public function setCrossingChars(string $cross, string $topLeft, string $topMid, string $topRight, string $midRight, string $bottomRight, string $bottomMid, string $bottomLeft, string $midLeft, string $topLeftBottom = null, string $topMidBottom = null, string $topRightBottom = null): static
public function setCrossingChars(string $cross, string $topLeft, string $topMid, string $topRight, string $midRight, string $bottomRight, string $bottomMid, string $bottomLeft, string $midLeft, ?string $topLeftBottom = null, ?string $topMidBottom = null, ?string $topRightBottom = null): static
{
$this->crossingChar = $cross;
$this->crossingTopLeftChar = $topLeft;
Expand Down
2 changes: 1 addition & 1 deletion Input/ArgvInput.php
Expand Up @@ -43,7 +43,7 @@ class ArgvInput extends Input
private array $tokens;
private array $parsed;

public function __construct(array $argv = null, InputDefinition $definition = null)
public function __construct(?array $argv = null, ?InputDefinition $definition = null)
{
$argv ??= $_SERVER['argv'] ?? [];

Expand Down
2 changes: 1 addition & 1 deletion Input/ArrayInput.php
Expand Up @@ -27,7 +27,7 @@ class ArrayInput extends Input
{
private array $parameters;

public function __construct(array $parameters, InputDefinition $definition = null)
public function __construct(array $parameters, ?InputDefinition $definition = null)
{
$this->parameters = $parameters;

Expand Down

0 comments on commit c5010d5

Please sign in to comment.