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 bf3502c + 4254548 commit dabf7e9
Show file tree
Hide file tree
Showing 78 changed files with 103 additions and 103 deletions.
6 changes: 3 additions & 3 deletions Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function offsetUnset(mixed $offset): void
throw new BadMethodCallException('Buttons cannot have children.');
}

public function setParent(FormInterface $parent = null): static
public function setParent(?FormInterface $parent = null): static
{
if (1 > \func_num_args()) {
trigger_deprecation('symfony/form', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
Expand All @@ -107,7 +107,7 @@ public function getParent(): ?FormInterface
*
* @throws BadMethodCallException
*/
public function add(string|FormInterface $child, string $type = null, array $options = []): static
public function add(string|FormInterface $child, ?string $type = null, array $options = []): static
{
throw new BadMethodCallException('Buttons cannot have children.');
}
Expand Down Expand Up @@ -338,7 +338,7 @@ public function isRoot(): bool
return null === $this->parent;
}

public function createView(FormView $parent = null): FormView
public function createView(?FormView $parent = null): FormView
{
if (null === $parent && $this->parent) {
$parent = $this->parent->createView();
Expand Down
6 changes: 3 additions & 3 deletions ButtonBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function __construct(?string $name, array $options = [])
*
* @throws BadMethodCallException
*/
public function add(string|FormBuilderInterface $child, string $type = null, array $options = []): static
public function add(string|FormBuilderInterface $child, ?string $type = null, array $options = []): static
{
throw new BadMethodCallException('Buttons cannot have children.');
}
Expand All @@ -68,7 +68,7 @@ public function add(string|FormBuilderInterface $child, string $type = null, arr
*
* @throws BadMethodCallException
*/
public function create(string $name, string $type = null, array $options = []): FormBuilderInterface
public function create(string $name, ?string $type = null, array $options = []): FormBuilderInterface
{
throw new BadMethodCallException('Buttons cannot have children.');
}
Expand Down Expand Up @@ -220,7 +220,7 @@ public function setAttributes(array $attributes): static
*
* @throws BadMethodCallException
*/
public function setDataMapper(DataMapperInterface $dataMapper = null): static
public function setDataMapper(?DataMapperInterface $dataMapper = null): static
{
if (1 > \func_num_args()) {
trigger_deprecation('symfony/form', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
Expand Down
2 changes: 1 addition & 1 deletion ChoiceList/ArrayChoiceList.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ArrayChoiceList implements ChoiceListInterface
* incrementing integers are used as
* values
*/
public function __construct(iterable $choices, callable $value = null)
public function __construct(iterable $choices, ?callable $value = null)
{
if ($choices instanceof \Traversable) {
$choices = iterator_to_array($choices);
Expand Down
6 changes: 3 additions & 3 deletions ChoiceList/Factory/Cache/ChoiceLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
*/
final class ChoiceLoader extends AbstractStaticOption implements ChoiceLoaderInterface
{
public function loadChoiceList(callable $value = null): ChoiceListInterface
public function loadChoiceList(?callable $value = null): ChoiceListInterface
{
return $this->getOption()->loadChoiceList($value);
}

public function loadChoicesForValues(array $values, callable $value = null): array
public function loadChoicesForValues(array $values, ?callable $value = null): array
{
return $this->getOption()->loadChoicesForValues($values, $value);
}

public function loadValuesForChoices(array $choices, callable $value = null): array
public function loadValuesForChoices(array $choices, ?callable $value = null): array
{
return $this->getOption()->loadValuesForChoices($choices, $value);
}
Expand Down
6 changes: 3 additions & 3 deletions ChoiceList/Factory/ChoiceListFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface ChoiceListFactoryInterface
*
* @param callable|null $filter The callable filtering the choices
*/
public function createListFromChoices(iterable $choices, callable $value = null, callable $filter = null): ChoiceListInterface;
public function createListFromChoices(iterable $choices, ?callable $value = null, ?callable $filter = null): ChoiceListInterface;

/**
* Creates a choice list that is loaded with the given loader.
Expand All @@ -44,7 +44,7 @@ public function createListFromChoices(iterable $choices, callable $value = null,
*
* @param callable|null $filter The callable filtering the choices
*/
public function createListFromLoader(ChoiceLoaderInterface $loader, callable $value = null, callable $filter = null): ChoiceListInterface;
public function createListFromLoader(ChoiceLoaderInterface $loader, ?callable $value = null, ?callable $filter = null): ChoiceListInterface;

/**
* Creates a view for the given choice list.
Expand Down Expand Up @@ -81,5 +81,5 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, callable $va
* on top of the list and in their original position
* or only in the top of the list
*/
public function createView(ChoiceListInterface $list, array|callable $preferredChoices = null, callable|false $label = null, callable $index = null, callable $groupBy = null, array|callable $attr = null, array|callable $labelTranslationParameters = []/* , bool $duplicatePreferredChoices = true */): ChoiceListView;
public function createView(ChoiceListInterface $list, array|callable|null $preferredChoices = null, callable|false|null $label = null, ?callable $index = null, ?callable $groupBy = null, array|callable|null $attr = null, array|callable $labelTranslationParameters = []/* , bool $duplicatePreferredChoices = true */): ChoiceListView;
}
6 changes: 3 additions & 3 deletions ChoiceList/Factory/DefaultChoiceListFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
class DefaultChoiceListFactory implements ChoiceListFactoryInterface
{
public function createListFromChoices(iterable $choices, callable $value = null, callable $filter = null): ChoiceListInterface
public function createListFromChoices(iterable $choices, ?callable $value = null, ?callable $filter = null): ChoiceListInterface
{
if ($filter) {
// filter the choice list lazily
Expand All @@ -43,7 +43,7 @@ public function createListFromChoices(iterable $choices, callable $value = null,
return new ArrayChoiceList($choices, $value);
}

public function createListFromLoader(ChoiceLoaderInterface $loader, callable $value = null, callable $filter = null): ChoiceListInterface
public function createListFromLoader(ChoiceLoaderInterface $loader, ?callable $value = null, ?callable $filter = null): ChoiceListInterface
{
if ($filter) {
$loader = new FilterChoiceLoaderDecorator($loader, $filter);
Expand All @@ -55,7 +55,7 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, callable $va
/**
* @param bool $duplicatePreferredChoices
*/
public function createView(ChoiceListInterface $list, array|callable $preferredChoices = null, callable|false $label = null, callable $index = null, callable $groupBy = null, array|callable $attr = null, array|callable $labelTranslationParameters = []/* , bool $duplicatePreferredChoices = true */): ChoiceListView
public function createView(ChoiceListInterface $list, array|callable|null $preferredChoices = null, callable|false|null $label = null, ?callable $index = null, ?callable $groupBy = null, array|callable|null $attr = null, array|callable $labelTranslationParameters = []/* , bool $duplicatePreferredChoices = true */): ChoiceListView
{
$duplicatePreferredChoices = \func_num_args() > 7 ? func_get_arg(7) : true;
$preferredViews = [];
Expand Down
2 changes: 1 addition & 1 deletion ChoiceList/Factory/PropertyAccessDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class PropertyAccessDecorator implements ChoiceListFactoryInterface
private ChoiceListFactoryInterface $decoratedFactory;
private PropertyAccessorInterface $propertyAccessor;

public function __construct(ChoiceListFactoryInterface $decoratedFactory, PropertyAccessorInterface $propertyAccessor = null)
public function __construct(ChoiceListFactoryInterface $decoratedFactory, ?PropertyAccessorInterface $propertyAccessor = null)
{
$this->decoratedFactory = $decoratedFactory;
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();
Expand Down
2 changes: 1 addition & 1 deletion ChoiceList/LazyChoiceList.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class LazyChoiceList implements ChoiceListInterface
*
* @param callable|null $value The callable generating the choice values
*/
public function __construct(ChoiceLoaderInterface $loader, callable $value = null)
public function __construct(ChoiceLoaderInterface $loader, ?callable $value = null)
{
$this->loader = $loader;
$this->value = null === $value ? null : $value(...);
Expand Down
6 changes: 3 additions & 3 deletions ChoiceList/Loader/AbstractChoiceLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ abstract class AbstractChoiceLoader implements ChoiceLoaderInterface
/**
* @final
*/
public function loadChoiceList(callable $value = null): ChoiceListInterface
public function loadChoiceList(?callable $value = null): ChoiceListInterface
{
return new ArrayChoiceList($this->choices ??= $this->loadChoices(), $value);
}

public function loadChoicesForValues(array $values, callable $value = null): array
public function loadChoicesForValues(array $values, ?callable $value = null): array
{
if (!$values) {
return [];
Expand All @@ -38,7 +38,7 @@ public function loadChoicesForValues(array $values, callable $value = null): arr
return $this->doLoadChoicesForValues($values, $value);
}

public function loadValuesForChoices(array $choices, callable $value = null): array
public function loadValuesForChoices(array $choices, ?callable $value = null): array
{
if (!$choices) {
return [];
Expand Down
6 changes: 3 additions & 3 deletions ChoiceList/Loader/ChoiceLoaderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ interface ChoiceLoaderInterface
* @param callable|null $value The callable which generates the values
* from choices
*/
public function loadChoiceList(callable $value = null): ChoiceListInterface;
public function loadChoiceList(?callable $value = null): ChoiceListInterface;

/**
* Loads the choices corresponding to the given values.
Expand All @@ -50,7 +50,7 @@ public function loadChoiceList(callable $value = null): ChoiceListInterface;
* values in this array are ignored
* @param callable|null $value The callable generating the choice values
*/
public function loadChoicesForValues(array $values, callable $value = null): array;
public function loadChoicesForValues(array $values, ?callable $value = null): array;

/**
* Loads the values corresponding to the given choices.
Expand All @@ -68,5 +68,5 @@ public function loadChoicesForValues(array $values, callable $value = null): arr
*
* @return string[]
*/
public function loadValuesForChoices(array $choices, callable $value = null): array;
public function loadValuesForChoices(array $choices, ?callable $value = null): array;
}
4 changes: 2 additions & 2 deletions ChoiceList/Loader/FilterChoiceLoaderDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ protected function loadChoices(): iterable
return $choices ?? [];
}

public function loadChoicesForValues(array $values, callable $value = null): array
public function loadChoicesForValues(array $values, ?callable $value = null): array
{
return array_filter($this->decoratedLoader->loadChoicesForValues($values, $value), $this->filter);
}

public function loadValuesForChoices(array $choices, callable $value = null): array
public function loadValuesForChoices(array $choices, ?callable $value = null): array
{
return $this->decoratedLoader->loadValuesForChoices(array_filter($choices, $this->filter), $value);
}
Expand Down
4 changes: 2 additions & 2 deletions ChoiceList/Loader/IntlCallbackChoiceLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
*/
class IntlCallbackChoiceLoader extends CallbackChoiceLoader
{
public function loadChoicesForValues(array $values, callable $value = null): array
public function loadChoicesForValues(array $values, ?callable $value = null): array
{
return parent::loadChoicesForValues(array_filter($values), $value);
}

public function loadValuesForChoices(array $choices, callable $value = null): array
public function loadValuesForChoices(array $choices, ?callable $value = null): array
{
$choices = array_filter($choices);

Expand Down
2 changes: 1 addition & 1 deletion Command/DebugCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class DebugCommand extends Command
private array $guessers;
private FileLinkFormatter|LegacyFileLinkFormatter|null $fileLinkFormatter;

public function __construct(FormRegistryInterface $formRegistry, array $namespaces = ['Symfony\Component\Form\Extension\Core\Type'], array $types = [], array $extensions = [], array $guessers = [], FileLinkFormatter|LegacyFileLinkFormatter $fileLinkFormatter = null)
public function __construct(FormRegistryInterface $formRegistry, array $namespaces = ['Symfony\Component\Form\Extension\Core\Type'], array $types = [], array $extensions = [], array $guessers = [], FileLinkFormatter|LegacyFileLinkFormatter|null $fileLinkFormatter = null)
{
parent::__construct();

Expand Down
4 changes: 2 additions & 2 deletions Console/Descriptor/TextDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class TextDescriptor extends Descriptor
{
private FileLinkFormatter|LegacyFileLinkFormatter|null $fileLinkFormatter;

public function __construct(FileLinkFormatter|LegacyFileLinkFormatter $fileLinkFormatter = null)
public function __construct(FileLinkFormatter|LegacyFileLinkFormatter|null $fileLinkFormatter = null)
{
$this->fileLinkFormatter = $fileLinkFormatter;
}
Expand Down Expand Up @@ -191,7 +191,7 @@ private function normalizeAndSortOptionsColumns(array $options): array
return $options;
}

private function formatClassLink(string $class, string $text = null): string
private function formatClassLink(string $class, ?string $text = null): string
{
$text ??= $class;

Expand Down
2 changes: 1 addition & 1 deletion Console/Helper/DescriptorHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
class DescriptorHelper extends BaseDescriptorHelper
{
public function __construct(FileLinkFormatter|LegacyFileLinkFormatter $fileLinkFormatter = null)
public function __construct(FileLinkFormatter|LegacyFileLinkFormatter|null $fileLinkFormatter = null)
{
$this
->register('txt', new TextDescriptor($fileLinkFormatter))
Expand Down
4 changes: 2 additions & 2 deletions Exception/TransformationFailedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class TransformationFailedException extends RuntimeException
private ?string $invalidMessage;
private array $invalidMessageParameters;

public function __construct(string $message = '', int $code = 0, \Throwable $previous = null, string $invalidMessage = null, array $invalidMessageParameters = [])
public function __construct(string $message = '', int $code = 0, ?\Throwable $previous = null, ?string $invalidMessage = null, array $invalidMessageParameters = [])
{
parent::__construct($message, $code, $previous);

Expand All @@ -34,7 +34,7 @@ public function __construct(string $message = '', int $code = 0, \Throwable $pre
* @param string|null $invalidMessage The message or message key
* @param array $invalidMessageParameters Data to be passed into the translator
*/
public function setInvalidMessage(string $invalidMessage = null, array $invalidMessageParameters = []): void
public function setInvalidMessage(?string $invalidMessage = null, array $invalidMessageParameters = []): void
{
if (1 > \func_num_args()) {
trigger_deprecation('symfony/form', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
Expand Down
2 changes: 1 addition & 1 deletion Extension/Core/CoreExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class CoreExtension extends AbstractExtension
private ChoiceListFactoryInterface $choiceListFactory;
private ?TranslatorInterface $translator;

public function __construct(PropertyAccessorInterface $propertyAccessor = null, ChoiceListFactoryInterface $choiceListFactory = null, TranslatorInterface $translator = null)
public function __construct(?PropertyAccessorInterface $propertyAccessor = null, ?ChoiceListFactoryInterface $choiceListFactory = null, ?TranslatorInterface $translator = null)
{
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();
$this->choiceListFactory = $choiceListFactory ?? new CachingFactoryDecorator(new PropertyAccessDecorator(new DefaultChoiceListFactory(), $this->propertyAccessor));
Expand Down
2 changes: 1 addition & 1 deletion Extension/Core/DataAccessor/PropertyPathAccessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class PropertyPathAccessor implements DataAccessorInterface
{
private PropertyAccessorInterface $propertyAccessor;

public function __construct(PropertyAccessorInterface $propertyAccessor = null)
public function __construct(?PropertyAccessorInterface $propertyAccessor = null)
{
$this->propertyAccessor = $propertyAccessor ?? PropertyAccess::createPropertyAccessor();
}
Expand Down
2 changes: 1 addition & 1 deletion Extension/Core/DataMapper/DataMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DataMapper implements DataMapperInterface
{
private DataAccessorInterface $dataAccessor;

public function __construct(DataAccessorInterface $dataAccessor = null)
public function __construct(?DataAccessorInterface $dataAccessor = null)
{
$this->dataAccessor = $dataAccessor ?? new ChainAccessor([
new CallbackAccessor(),
Expand Down
2 changes: 1 addition & 1 deletion Extension/Core/DataTransformer/BaseDateTimeTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ abstract class BaseDateTimeTransformer implements DataTransformerInterface
*
* @throws InvalidArgumentException if a timezone is not valid
*/
public function __construct(string $inputTimezone = null, string $outputTimezone = null)
public function __construct(?string $inputTimezone = null, ?string $outputTimezone = null)
{
$this->inputTimezone = $inputTimezone ?: date_default_timezone_get();
$this->outputTimezone = $outputTimezone ?: date_default_timezone_get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class DateIntervalToArrayTransformer implements DataTransformerInterface
* @param string[]|null $fields The date fields
* @param bool $pad Whether to use padding
*/
public function __construct(array $fields = null, bool $pad = false)
public function __construct(?array $fields = null, bool $pad = false)
{
$this->fields = $fields ?? ['years', 'months', 'days', 'hours', 'minutes', 'seconds', 'invert'];
$this->pad = $pad;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class DateTimeToArrayTransformer extends BaseDateTimeTransformer
* @param string[]|null $fields The date fields
* @param bool $pad Whether to use padding
*/
public function __construct(string $inputTimezone = null, string $outputTimezone = null, array $fields = null, bool $pad = false, \DateTimeInterface $referenceDate = null)
public function __construct(?string $inputTimezone = null, ?string $outputTimezone = null, ?array $fields = null, bool $pad = false, ?\DateTimeInterface $referenceDate = null)
{
parent::__construct($inputTimezone, $outputTimezone);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class DateTimeToHtml5LocalDateTimeTransformer extends BaseDateTimeTransformer
public const HTML5_FORMAT = 'Y-m-d\\TH:i:s';
public const HTML5_FORMAT_NO_SECONDS = 'Y-m-d\\TH:i';

public function __construct(string $inputTimezone = null, string $outputTimezone = null, private bool $withSeconds = false)
public function __construct(?string $inputTimezone = null, ?string $outputTimezone = null, private bool $withSeconds = false)
{
parent::__construct($inputTimezone, $outputTimezone);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class DateTimeToLocalizedStringTransformer extends BaseDateTimeTransformer
*
* @throws UnexpectedTypeException If a format is not supported or if a timezone is not a string
*/
public function __construct(string $inputTimezone = null, string $outputTimezone = null, int $dateFormat = null, int $timeFormat = null, int $calendar = \IntlDateFormatter::GREGORIAN, string $pattern = null)
public function __construct(?string $inputTimezone = null, ?string $outputTimezone = null, ?int $dateFormat = null, ?int $timeFormat = null, int $calendar = \IntlDateFormatter::GREGORIAN, ?string $pattern = null)
{
parent::__construct($inputTimezone, $outputTimezone);

Expand Down
Loading

0 comments on commit dabf7e9

Please sign in to comment.