Skip to content

Commit 76bfa17

Browse files
Merge branch '6.4' into 7.0
* 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
2 parents 02b2a2a + dabf7e9 commit 76bfa17

File tree

77 files changed

+97
-97
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+97
-97
lines changed

Button.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function getParent(): ?FormInterface
104104
*
105105
* @throws BadMethodCallException
106106
*/
107-
public function add(string|FormInterface $child, string $type = null, array $options = []): static
107+
public function add(string|FormInterface $child, ?string $type = null, array $options = []): static
108108
{
109109
throw new BadMethodCallException('Buttons cannot have children.');
110110
}
@@ -335,7 +335,7 @@ public function isRoot(): bool
335335
return null === $this->parent;
336336
}
337337

338-
public function createView(FormView $parent = null): FormView
338+
public function createView(?FormView $parent = null): FormView
339339
{
340340
if (null === $parent && $this->parent) {
341341
$parent = $this->parent->createView();

ButtonBuilder.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function __construct(?string $name, array $options = [])
5353
*
5454
* @throws BadMethodCallException
5555
*/
56-
public function add(string|FormBuilderInterface $child, string $type = null, array $options = []): never
56+
public function add(string|FormBuilderInterface $child, ?string $type = null, array $options = []): never
5757
{
5858
throw new BadMethodCallException('Buttons cannot have children.');
5959
}
@@ -63,7 +63,7 @@ public function add(string|FormBuilderInterface $child, string $type = null, arr
6363
*
6464
* @throws BadMethodCallException
6565
*/
66-
public function create(string $name, string $type = null, array $options = []): never
66+
public function create(string $name, ?string $type = null, array $options = []): never
6767
{
6868
throw new BadMethodCallException('Buttons cannot have children.');
6969
}

ChoiceList/ArrayChoiceList.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class ArrayChoiceList implements ChoiceListInterface
4848
* incrementing integers are used as
4949
* values
5050
*/
51-
public function __construct(iterable $choices, callable $value = null)
51+
public function __construct(iterable $choices, ?callable $value = null)
5252
{
5353
if ($choices instanceof \Traversable) {
5454
$choices = iterator_to_array($choices);

ChoiceList/Factory/Cache/ChoiceLoader.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@
2626
*/
2727
final class ChoiceLoader extends AbstractStaticOption implements ChoiceLoaderInterface
2828
{
29-
public function loadChoiceList(callable $value = null): ChoiceListInterface
29+
public function loadChoiceList(?callable $value = null): ChoiceListInterface
3030
{
3131
return $this->getOption()->loadChoiceList($value);
3232
}
3333

34-
public function loadChoicesForValues(array $values, callable $value = null): array
34+
public function loadChoicesForValues(array $values, ?callable $value = null): array
3535
{
3636
return $this->getOption()->loadChoicesForValues($values, $value);
3737
}
3838

39-
public function loadValuesForChoices(array $choices, callable $value = null): array
39+
public function loadValuesForChoices(array $choices, ?callable $value = null): array
4040
{
4141
return $this->getOption()->loadValuesForChoices($choices, $value);
4242
}

ChoiceList/Factory/ChoiceListFactoryInterface.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ interface ChoiceListFactoryInterface
3333
*
3434
* @param callable|null $filter The callable filtering the choices
3535
*/
36-
public function createListFromChoices(iterable $choices, callable $value = null, callable $filter = null): ChoiceListInterface;
36+
public function createListFromChoices(iterable $choices, ?callable $value = null, ?callable $filter = null): ChoiceListInterface;
3737

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

4949
/**
5050
* Creates a view for the given choice list.
@@ -81,5 +81,5 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, callable $va
8181
* on top of the list and in their original position
8282
* or only in the top of the list
8383
*/
84-
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;
84+
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;
8585
}

ChoiceList/Factory/DefaultChoiceListFactory.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
*/
3131
class DefaultChoiceListFactory implements ChoiceListFactoryInterface
3232
{
33-
public function createListFromChoices(iterable $choices, callable $value = null, callable $filter = null): ChoiceListInterface
33+
public function createListFromChoices(iterable $choices, ?callable $value = null, ?callable $filter = null): ChoiceListInterface
3434
{
3535
if ($filter) {
3636
// filter the choice list lazily
@@ -43,7 +43,7 @@ public function createListFromChoices(iterable $choices, callable $value = null,
4343
return new ArrayChoiceList($choices, $value);
4444
}
4545

46-
public function createListFromLoader(ChoiceLoaderInterface $loader, callable $value = null, callable $filter = null): ChoiceListInterface
46+
public function createListFromLoader(ChoiceLoaderInterface $loader, ?callable $value = null, ?callable $filter = null): ChoiceListInterface
4747
{
4848
if ($filter) {
4949
$loader = new FilterChoiceLoaderDecorator($loader, $filter);
@@ -52,7 +52,7 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, callable $va
5252
return new LazyChoiceList($loader, $value);
5353
}
5454

55-
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
55+
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
5656
{
5757
$preferredViews = [];
5858
$preferredViewsOrder = [];

ChoiceList/Factory/PropertyAccessDecorator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class PropertyAccessDecorator implements ChoiceListFactoryInterface
4141
private ChoiceListFactoryInterface $decoratedFactory;
4242
private PropertyAccessorInterface $propertyAccessor;
4343

44-
public function __construct(ChoiceListFactoryInterface $decoratedFactory, PropertyAccessorInterface $propertyAccessor = null)
44+
public function __construct(ChoiceListFactoryInterface $decoratedFactory, ?PropertyAccessorInterface $propertyAccessor = null)
4545
{
4646
$this->decoratedFactory = $decoratedFactory;
4747
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();

ChoiceList/LazyChoiceList.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class LazyChoiceList implements ChoiceListInterface
4545
*
4646
* @param callable|null $value The callable generating the choice values
4747
*/
48-
public function __construct(ChoiceLoaderInterface $loader, callable $value = null)
48+
public function __construct(ChoiceLoaderInterface $loader, ?callable $value = null)
4949
{
5050
$this->loader = $loader;
5151
$this->value = null === $value ? null : $value(...);

ChoiceList/Loader/AbstractChoiceLoader.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ abstract class AbstractChoiceLoader implements ChoiceLoaderInterface
2424
/**
2525
* @final
2626
*/
27-
public function loadChoiceList(callable $value = null): ChoiceListInterface
27+
public function loadChoiceList(?callable $value = null): ChoiceListInterface
2828
{
2929
return new ArrayChoiceList($this->choices ??= $this->loadChoices(), $value);
3030
}
3131

32-
public function loadChoicesForValues(array $values, callable $value = null): array
32+
public function loadChoicesForValues(array $values, ?callable $value = null): array
3333
{
3434
if (!$values) {
3535
return [];
@@ -38,7 +38,7 @@ public function loadChoicesForValues(array $values, callable $value = null): arr
3838
return $this->doLoadChoicesForValues($values, $value);
3939
}
4040

41-
public function loadValuesForChoices(array $choices, callable $value = null): array
41+
public function loadValuesForChoices(array $choices, ?callable $value = null): array
4242
{
4343
if (!$choices) {
4444
return [];

ChoiceList/Loader/ChoiceLoaderInterface.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ interface ChoiceLoaderInterface
3434
* @param callable|null $value The callable which generates the values
3535
* from choices
3636
*/
37-
public function loadChoiceList(callable $value = null): ChoiceListInterface;
37+
public function loadChoiceList(?callable $value = null): ChoiceListInterface;
3838

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

5555
/**
5656
* Loads the values corresponding to the given choices.
@@ -68,5 +68,5 @@ public function loadChoicesForValues(array $values, callable $value = null): arr
6868
*
6969
* @return string[]
7070
*/
71-
public function loadValuesForChoices(array $choices, callable $value = null): array;
71+
public function loadValuesForChoices(array $choices, ?callable $value = null): array;
7272
}

ChoiceList/Loader/FilterChoiceLoaderDecorator.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ protected function loadChoices(): iterable
5252
return $choices ?? [];
5353
}
5454

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

60-
public function loadValuesForChoices(array $choices, callable $value = null): array
60+
public function loadValuesForChoices(array $choices, ?callable $value = null): array
6161
{
6262
return $this->decoratedLoader->loadValuesForChoices(array_filter($choices, $this->filter), $value);
6363
}

ChoiceList/Loader/IntlCallbackChoiceLoader.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
*/
2020
class IntlCallbackChoiceLoader extends CallbackChoiceLoader
2121
{
22-
public function loadChoicesForValues(array $values, callable $value = null): array
22+
public function loadChoicesForValues(array $values, ?callable $value = null): array
2323
{
2424
return parent::loadChoicesForValues(array_filter($values), $value);
2525
}
2626

27-
public function loadValuesForChoices(array $choices, callable $value = null): array
27+
public function loadValuesForChoices(array $choices, ?callable $value = null): array
2828
{
2929
$choices = array_filter($choices);
3030

Command/DebugCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class DebugCommand extends Command
4242
private array $guessers;
4343
private ?FileLinkFormatter $fileLinkFormatter;
4444

45-
public function __construct(FormRegistryInterface $formRegistry, array $namespaces = ['Symfony\Component\Form\Extension\Core\Type'], array $types = [], array $extensions = [], array $guessers = [], FileLinkFormatter $fileLinkFormatter = null)
45+
public function __construct(FormRegistryInterface $formRegistry, array $namespaces = ['Symfony\Component\Form\Extension\Core\Type'], array $types = [], array $extensions = [], array $guessers = [], ?FileLinkFormatter $fileLinkFormatter = null)
4646
{
4747
parent::__construct();
4848

Console/Descriptor/TextDescriptor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ private function normalizeAndSortOptionsColumns(array $options): array
188188
return $options;
189189
}
190190

191-
private function formatClassLink(string $class, string $text = null): string
191+
private function formatClassLink(string $class, ?string $text = null): string
192192
{
193193
$text ??= $class;
194194

Console/Helper/DescriptorHelper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424
class DescriptorHelper extends BaseDescriptorHelper
2525
{
26-
public function __construct(FileLinkFormatter $fileLinkFormatter = null)
26+
public function __construct(?FileLinkFormatter $fileLinkFormatter = null)
2727
{
2828
$this
2929
->register('txt', new TextDescriptor($fileLinkFormatter))

Exception/TransformationFailedException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class TransformationFailedException extends RuntimeException
2121
private ?string $invalidMessage;
2222
private array $invalidMessageParameters;
2323

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

Extension/Core/CoreExtension.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class CoreExtension extends AbstractExtension
3232
private ChoiceListFactoryInterface $choiceListFactory;
3333
private ?TranslatorInterface $translator;
3434

35-
public function __construct(PropertyAccessorInterface $propertyAccessor = null, ChoiceListFactoryInterface $choiceListFactory = null, TranslatorInterface $translator = null)
35+
public function __construct(?PropertyAccessorInterface $propertyAccessor = null, ?ChoiceListFactoryInterface $choiceListFactory = null, ?TranslatorInterface $translator = null)
3636
{
3737
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();
3838
$this->choiceListFactory = $choiceListFactory ?? new CachingFactoryDecorator(new PropertyAccessDecorator(new DefaultChoiceListFactory(), $this->propertyAccessor));

Extension/Core/DataAccessor/PropertyPathAccessor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class PropertyPathAccessor implements DataAccessorInterface
3131
{
3232
private PropertyAccessorInterface $propertyAccessor;
3333

34-
public function __construct(PropertyAccessorInterface $propertyAccessor = null)
34+
public function __construct(?PropertyAccessorInterface $propertyAccessor = null)
3535
{
3636
$this->propertyAccessor = $propertyAccessor ?? PropertyAccess::createPropertyAccessor();
3737
}

Extension/Core/DataMapper/DataMapper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class DataMapper implements DataMapperInterface
2727
{
2828
private DataAccessorInterface $dataAccessor;
2929

30-
public function __construct(DataAccessorInterface $dataAccessor = null)
30+
public function __construct(?DataAccessorInterface $dataAccessor = null)
3131
{
3232
$this->dataAccessor = $dataAccessor ?? new ChainAccessor([
3333
new CallbackAccessor(),

Extension/Core/DataTransformer/BaseDateTimeTransformer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ abstract class BaseDateTimeTransformer implements DataTransformerInterface
3838
*
3939
* @throws InvalidArgumentException if a timezone is not valid
4040
*/
41-
public function __construct(string $inputTimezone = null, string $outputTimezone = null)
41+
public function __construct(?string $inputTimezone = null, ?string $outputTimezone = null)
4242
{
4343
$this->inputTimezone = $inputTimezone ?: date_default_timezone_get();
4444
$this->outputTimezone = $outputTimezone ?: date_default_timezone_get();

Extension/Core/DataTransformer/DateIntervalToArrayTransformer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class DateIntervalToArrayTransformer implements DataTransformerInterface
4848
* @param string[]|null $fields The date fields
4949
* @param bool $pad Whether to use padding
5050
*/
51-
public function __construct(array $fields = null, bool $pad = false)
51+
public function __construct(?array $fields = null, bool $pad = false)
5252
{
5353
$this->fields = $fields ?? ['years', 'months', 'days', 'hours', 'minutes', 'seconds', 'invert'];
5454
$this->pad = $pad;

Extension/Core/DataTransformer/DateTimeToArrayTransformer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class DateTimeToArrayTransformer extends BaseDateTimeTransformer
3333
* @param string[]|null $fields The date fields
3434
* @param bool $pad Whether to use padding
3535
*/
36-
public function __construct(string $inputTimezone = null, string $outputTimezone = null, array $fields = null, bool $pad = false, \DateTimeInterface $referenceDate = null)
36+
public function __construct(?string $inputTimezone = null, ?string $outputTimezone = null, ?array $fields = null, bool $pad = false, ?\DateTimeInterface $referenceDate = null)
3737
{
3838
parent::__construct($inputTimezone, $outputTimezone);
3939

Extension/Core/DataTransformer/DateTimeToHtml5LocalDateTimeTransformer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class DateTimeToHtml5LocalDateTimeTransformer extends BaseDateTimeTransformer
2525
public const HTML5_FORMAT = 'Y-m-d\\TH:i:s';
2626
public const HTML5_FORMAT_NO_SECONDS = 'Y-m-d\\TH:i';
2727

28-
public function __construct(string $inputTimezone = null, string $outputTimezone = null, private bool $withSeconds = false)
28+
public function __construct(?string $inputTimezone = null, ?string $outputTimezone = null, private bool $withSeconds = false)
2929
{
3030
parent::__construct($inputTimezone, $outputTimezone);
3131
}

Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class DateTimeToLocalizedStringTransformer extends BaseDateTimeTransformer
4141
*
4242
* @throws UnexpectedTypeException If a format is not supported or if a timezone is not a string
4343
*/
44-
public function __construct(string $inputTimezone = null, string $outputTimezone = null, int $dateFormat = null, int $timeFormat = null, int $calendar = \IntlDateFormatter::GREGORIAN, string $pattern = null)
44+
public function __construct(?string $inputTimezone = null, ?string $outputTimezone = null, ?int $dateFormat = null, ?int $timeFormat = null, int $calendar = \IntlDateFormatter::GREGORIAN, ?string $pattern = null)
4545
{
4646
parent::__construct($inputTimezone, $outputTimezone);
4747

Extension/Core/DataTransformer/DateTimeToStringTransformer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class DateTimeToStringTransformer extends BaseDateTimeTransformer
4747
* @param string $format The date format
4848
* @param string|null $parseFormat The parse format when different from $format
4949
*/
50-
public function __construct(string $inputTimezone = null, string $outputTimezone = null, string $format = 'Y-m-d H:i:s', string $parseFormat = null)
50+
public function __construct(?string $inputTimezone = null, ?string $outputTimezone = null, string $format = 'Y-m-d H:i:s', ?string $parseFormat = null)
5151
{
5252
parent::__construct($inputTimezone, $outputTimezone);
5353

Extension/Core/DataTransformer/IntegerToLocalizedStringTransformer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class IntegerToLocalizedStringTransformer extends NumberToLocalizedStringTransfo
2828
* @param int|null $roundingMode One of the ROUND_ constants in this class
2929
* @param string|null $locale locale used for transforming
3030
*/
31-
public function __construct(?bool $grouping = false, ?int $roundingMode = \NumberFormatter::ROUND_DOWN, string $locale = null)
31+
public function __construct(?bool $grouping = false, ?int $roundingMode = \NumberFormatter::ROUND_DOWN, ?string $locale = null)
3232
{
3333
parent::__construct(0, $grouping, $roundingMode, $locale);
3434
}

Extension/Core/DataTransformer/MoneyToLocalizedStringTransformer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class MoneyToLocalizedStringTransformer extends NumberToLocalizedStringTransform
2323
{
2424
private int $divisor;
2525

26-
public function __construct(?int $scale = 2, ?bool $grouping = true, ?int $roundingMode = \NumberFormatter::ROUND_HALFUP, ?int $divisor = 1, string $locale = null)
26+
public function __construct(?int $scale = 2, ?bool $grouping = true, ?int $roundingMode = \NumberFormatter::ROUND_HALFUP, ?int $divisor = 1, ?string $locale = null)
2727
{
2828
parent::__construct($scale ?? 2, $grouping ?? true, $roundingMode, $locale);
2929

Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class NumberToLocalizedStringTransformer implements DataTransformerInterface
3131
private ?int $scale;
3232
private ?string $locale;
3333

34-
public function __construct(int $scale = null, ?bool $grouping = false, ?int $roundingMode = \NumberFormatter::ROUND_HALFUP, string $locale = null)
34+
public function __construct(?int $scale = null, ?bool $grouping = false, ?int $roundingMode = \NumberFormatter::ROUND_HALFUP, ?string $locale = null)
3535
{
3636
$this->scale = $scale;
3737
$this->grouping = $grouping ?? false;

0 commit comments

Comments
 (0)