Skip to content

Commit 36c0de2

Browse files
Merge branch '5.4' into 6.3
* 5.4: 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 80a1496 + c827d42 commit 36c0de2

File tree

79 files changed

+222
-104
lines changed

Some content is hidden

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

79 files changed

+222
-104
lines changed

Button.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function offsetUnset(mixed $offset): void
8181
throw new BadMethodCallException('Buttons cannot have children.');
8282
}
8383

84-
public function setParent(FormInterface $parent = null): static
84+
public function setParent(?FormInterface $parent = null): static
8585
{
8686
if (1 > \func_num_args()) {
8787
trigger_deprecation('symfony/form', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
@@ -107,7 +107,7 @@ public function getParent(): ?FormInterface
107107
*
108108
* @throws BadMethodCallException
109109
*/
110-
public function add(string|FormInterface $child, string $type = null, array $options = []): static
110+
public function add(string|FormInterface $child, ?string $type = null, array $options = []): static
111111
{
112112
throw new BadMethodCallException('Buttons cannot have children.');
113113
}
@@ -338,7 +338,7 @@ public function isRoot(): bool
338338
return null === $this->parent;
339339
}
340340

341-
public function createView(FormView $parent = null): FormView
341+
public function createView(?FormView $parent = null): FormView
342342
{
343343
if (null === $parent && $this->parent) {
344344
$parent = $this->parent->createView();

ButtonBuilder.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function __construct(?string $name, array $options = [])
5656
*
5757
* @throws BadMethodCallException
5858
*/
59-
public function add(string|FormBuilderInterface $child, string $type = null, array $options = []): static
59+
public function add(string|FormBuilderInterface $child, ?string $type = null, array $options = []): static
6060
{
6161
throw new BadMethodCallException('Buttons cannot have children.');
6262
}
@@ -68,7 +68,7 @@ public function add(string|FormBuilderInterface $child, string $type = null, arr
6868
*
6969
* @throws BadMethodCallException
7070
*/
71-
public function create(string $name, string $type = null, array $options = []): FormBuilderInterface
71+
public function create(string $name, ?string $type = null, array $options = []): FormBuilderInterface
7272
{
7373
throw new BadMethodCallException('Buttons cannot have children.');
7474
}
@@ -220,7 +220,7 @@ public function setAttributes(array $attributes): static
220220
*
221221
* @throws BadMethodCallException
222222
*/
223-
public function setDataMapper(DataMapperInterface $dataMapper = null): static
223+
public function setDataMapper(?DataMapperInterface $dataMapper = null): static
224224
{
225225
if (1 > \func_num_args()) {
226226
trigger_deprecation('symfony/form', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);

ChoiceList/ArrayChoiceList.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class ArrayChoiceList implements ChoiceListInterface
5757
* incrementing integers are used as
5858
* values
5959
*/
60-
public function __construct(iterable $choices, callable $value = null)
60+
public function __construct(iterable $choices, ?callable $value = null)
6161
{
6262
if ($choices instanceof \Traversable) {
6363
$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.
@@ -78,5 +78,5 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, callable $va
7878
* @param array|callable|null $attr The callable generating the HTML attributes
7979
* @param array|callable $labelTranslationParameters The parameters used to translate the choice labels
8080
*/
81-
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 = []): ChoiceListView;
81+
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 = []): ChoiceListView;
8282
}

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 = []): 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 = []): 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

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class TextDescriptor extends Descriptor
2626
{
2727
private ?FileLinkFormatter $fileLinkFormatter;
2828

29-
public function __construct(FileLinkFormatter $fileLinkFormatter = null)
29+
public function __construct(?FileLinkFormatter $fileLinkFormatter = null)
3030
{
3131
$this->fileLinkFormatter = $fileLinkFormatter;
3232
}
@@ -190,7 +190,7 @@ private function normalizeAndSortOptionsColumns(array $options): array
190190
return $options;
191191
}
192192

193-
private function formatClassLink(string $class, string $text = null): string
193+
private function formatClassLink(string $class, ?string $text = null): string
194194
{
195195
$text ??= $class;
196196

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

+2-2
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

@@ -34,7 +34,7 @@ public function __construct(string $message = '', int $code = 0, \Throwable $pre
3434
* @param string|null $invalidMessage The message or message key
3535
* @param array $invalidMessageParameters Data to be passed into the translator
3636
*/
37-
public function setInvalidMessage(string $invalidMessage = null, array $invalidMessageParameters = []): void
37+
public function setInvalidMessage(?string $invalidMessage = null, array $invalidMessageParameters = []): void
3838
{
3939
if (1 > \func_num_args()) {
4040
trigger_deprecation('symfony/form', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);

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(),

0 commit comments

Comments
 (0)