Skip to content

Commit 624d1aa

Browse files
Merge branch '7.0' into 7.1
* 7.0: List CS fix in .git-blame-ignore-revs 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 8a2b584 + 76bfa17 commit 624d1aa

File tree

61 files changed

+89
-89
lines changed

Some content is hidden

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

61 files changed

+89
-89
lines changed

Button.php

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

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

ButtonBuilder.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function __construct(
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
@@ -46,7 +46,7 @@ class LazyChoiceList implements ChoiceListInterface
4646
*/
4747
public function __construct(
4848
private ChoiceLoaderInterface $loader,
49-
callable $value = null,
49+
?callable $value = null,
5050
) {
5151
$this->value = null === $value ? null : $value(...);
5252
}

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

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class CoreExtension extends AbstractExtension
3232
private ChoiceListFactoryInterface $choiceListFactory;
3333

3434
public function __construct(
35-
PropertyAccessorInterface $propertyAccessor = null,
36-
ChoiceListFactoryInterface $choiceListFactory = null,
35+
?PropertyAccessorInterface $propertyAccessor = null,
36+
?ChoiceListFactoryInterface $choiceListFactory = null,
3737
private ?TranslatorInterface $translator = null,
3838
) {
3939
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();

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 bool $pad Whether to use padding
4949
*/
5050
public function __construct(
51-
array $fields = null,
51+
?array $fields = null,
5252
private bool $pad = false,
5353
) {
5454
$this->fields = $fields ?? ['years', 'months', 'days', 'hours', 'minutes', 'seconds', 'invert'];

Extension/Core/DataTransformer/DateTimeToArrayTransformer.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ class DateTimeToArrayTransformer extends BaseDateTimeTransformer
3333
* @param bool $pad Whether to use padding
3434
*/
3535
public function __construct(
36-
string $inputTimezone = null,
37-
string $outputTimezone = null,
38-
array $fields = null,
36+
?string $inputTimezone = null,
37+
?string $outputTimezone = null,
38+
?array $fields = null,
3939
private bool $pad = false,
40-
\DateTimeInterface $referenceDate = null,
40+
?\DateTimeInterface $referenceDate = null,
4141
) {
4242
parent::__construct($inputTimezone, $outputTimezone);
4343

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ class DateTimeToLocalizedStringTransformer extends BaseDateTimeTransformer
4040
* @throws UnexpectedTypeException If a format is not supported or if a timezone is not a string
4141
*/
4242
public function __construct(
43-
string $inputTimezone = null,
44-
string $outputTimezone = null,
45-
int $dateFormat = null,
46-
int $timeFormat = null,
43+
?string $inputTimezone = null,
44+
?string $outputTimezone = null,
45+
?int $dateFormat = null,
46+
?int $timeFormat = null,
4747
private int $calendar = \IntlDateFormatter::GREGORIAN,
4848
private ?string $pattern = null,
4949
) {

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
@@ -28,7 +28,7 @@ public function __construct(
2828
?bool $grouping = true,
2929
?int $roundingMode = \NumberFormatter::ROUND_HALFUP,
3030
?int $divisor = 1,
31-
string $locale = null,
31+
?string $locale = null,
3232
private string $modelType = 'float',
3333
) {
3434
parent::__construct($scale ?? 2, $grouping ?? true, $roundingMode, $locale);

Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ class PercentToLocalizedStringTransformer implements DataTransformerInterface
4545
* @throws UnexpectedTypeException if the given value of type is unknown
4646
*/
4747
public function __construct(
48-
int $scale = null,
49-
string $type = null,
48+
?int $scale = null,
49+
?string $type = null,
5050
private int $roundingMode = \NumberFormatter::ROUND_HALFUP,
5151
private bool $html5Format = false,
5252
) {

Extension/Core/EventListener/ResizeFormListener.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(
3434
private bool $allowAdd = false,
3535
private bool $allowDelete = false,
3636
bool|callable $deleteEmpty = false,
37-
array $prototypeOptions = null,
37+
?array $prototypeOptions = null,
3838
private bool $keepAsList = false,
3939
) {
4040
$this->deleteEmpty = \is_bool($deleteEmpty) ? $deleteEmpty : $deleteEmpty(...);

Extension/Core/Type/ChoiceType.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class ChoiceType extends AbstractType
5353
private ChoiceListFactoryInterface $choiceListFactory;
5454
private ?TranslatorInterface $translator;
5555

56-
public function __construct(ChoiceListFactoryInterface $choiceListFactory = null, TranslatorInterface $translator = null)
56+
public function __construct(?ChoiceListFactoryInterface $choiceListFactory = null, ?TranslatorInterface $translator = null)
5757
{
5858
$this->choiceListFactory = $choiceListFactory ?? new CachingFactoryDecorator(
5959
new PropertyAccessDecorator(

Extension/Core/Type/FormType.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class FormType extends BaseType
3030
{
3131
private DataMapper $dataMapper;
3232

33-
public function __construct(PropertyAccessorInterface $propertyAccessor = null)
33+
public function __construct(?PropertyAccessorInterface $propertyAccessor = null)
3434
{
3535
$this->dataMapper = new DataMapper(new ChainAccessor([
3636
new CallbackAccessor(),

0 commit comments

Comments
 (0)