Skip to content

Commit

Permalink
Merge branch '6.3' into 6.4
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nicolas-grekas committed Jan 23, 2024
2 parents 3068eac + 3540f06 commit 2aaf83b
Show file tree
Hide file tree
Showing 39 changed files with 71 additions and 71 deletions.
6 changes: 3 additions & 3 deletions Application.php
Expand Up @@ -143,7 +143,7 @@ public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent)
*
* @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 @@ -795,7 +795,7 @@ public function find(string $name)
*
* @return Command[]
*/
public function all(string $namespace = null)
public function all(?string $namespace = null)
{
$this->init();

Expand Down Expand Up @@ -1177,7 +1177,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
8 changes: 4 additions & 4 deletions Command/Command.php
Expand Up @@ -111,7 +111,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 @@ -152,7 +152,7 @@ public function ignoreValidationErrors()
/**
* @return void
*/
public function setApplication(Application $application = null)
public function setApplication(?Application $application = null)
{
if (1 > \func_num_args()) {
trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
Expand Down Expand Up @@ -460,7 +460,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 = null */): static
public function addArgument(string $name, ?int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = null */): static
{
$suggestedValues = 5 <= \func_num_args() ? func_get_arg(4) : [];
if (!\is_array($suggestedValues) && !$suggestedValues instanceof \Closure) {
Expand All @@ -484,7 +484,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
{
$suggestedValues = 6 <= \func_num_args() ? func_get_arg(5) : [];
if (!\is_array($suggestedValues) && !$suggestedValues instanceof \Closure) {
Expand Down
6 changes: 3 additions & 3 deletions Command/LazyCommand.php
Expand Up @@ -45,7 +45,7 @@ public function ignoreValidationErrors(): void
$this->getCommand()->ignoreValidationErrors();
}

public function setApplication(Application $application = null): void
public function setApplication(?Application $application = null): void
{
if (1 > \func_num_args()) {
trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
Expand Down Expand Up @@ -116,7 +116,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
{
$suggestedValues = 5 <= \func_num_args() ? func_get_arg(4) : [];
$this->getCommand()->addArgument($name, $mode, $description, $default, $suggestedValues);
Expand All @@ -127,7 +127,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
{
$suggestedValues = 6 <= \func_num_args() ? func_get_arg(5) : [];
$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
4 changes: 2 additions & 2 deletions Formatter/NullOutputFormatterStyle.php
Expand Up @@ -21,15 +21,15 @@ public function apply(string $text): string
return $text;
}

public function setBackground(string $color = null): void
public function setBackground(?string $color = null): void
{
if (1 > \func_num_args()) {
trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
}
// do nothing
}

public function setForeground(string $color = null): void
public function setForeground(?string $color = null): void
{
if (1 > \func_num_args()) {
trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
Expand Down
6 changes: 3 additions & 3 deletions Formatter/OutputFormatterStyle.php
Expand Up @@ -33,15 +33,15 @@ 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);
}

/**
* @return void
*/
public function setForeground(string $color = null)
public function setForeground(?string $color = null)
{
if (1 > \func_num_args()) {
trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
Expand All @@ -52,7 +52,7 @@ public function setForeground(string $color = null)
/**
* @return void
*/
public function setBackground(string $color = null)
public function setBackground(?string $color = null)
{
if (1 > \func_num_args()) {
trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
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 Down Expand Up @@ -57,7 +57,7 @@ public function push(OutputFormatterStyleInterface $style)
*
* @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
4 changes: 2 additions & 2 deletions Helper/Helper.php
Expand Up @@ -26,7 +26,7 @@ abstract class Helper implements HelperInterface
/**
* @return void
*/
public function setHelperSet(HelperSet $helperSet = null)
public function setHelperSet(?HelperSet $helperSet = null)
{
if (1 > \func_num_args()) {
trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
Expand Down Expand Up @@ -80,7 +80,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 @@ -38,7 +38,7 @@ public function __construct(array $helpers = [])
/**
* @return void
*/
public function set(HelperInterface $helper, string $alias = null)
public function set(HelperInterface $helper, ?string $alias = null)
{
$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

0 comments on commit 2aaf83b

Please sign in to comment.