Skip to content

Commit d069fbf

Browse files
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
1 parent cab43d0 commit d069fbf

File tree

77 files changed

+104
-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.

77 files changed

+104
-104
lines changed

Button.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function offsetUnset($offset)
114114
/**
115115
* {@inheritdoc}
116116
*/
117-
public function setParent(FormInterface $parent = null)
117+
public function setParent(?FormInterface $parent = null)
118118
{
119119
if ($this->submitted) {
120120
throw new AlreadySubmittedException('You cannot set the parent of a submitted button.');
@@ -140,7 +140,7 @@ public function getParent()
140140
*
141141
* @throws BadMethodCallException
142142
*/
143-
public function add($child, string $type = null, array $options = [])
143+
public function add($child, ?string $type = null, array $options = [])
144144
{
145145
throw new BadMethodCallException('Buttons cannot have children.');
146146
}
@@ -414,7 +414,7 @@ public function isRoot()
414414
/**
415415
* {@inheritdoc}
416416
*/
417-
public function createView(FormView $parent = null)
417+
public function createView(?FormView $parent = null)
418418
{
419419
if (null === $parent && $this->parent) {
420420
$parent = $this->parent->createView();

ButtonBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function __construct(?string $name, array $options = [])
7171
*
7272
* @throws BadMethodCallException
7373
*/
74-
public function add($child, string $type = null, array $options = [])
74+
public function add($child, ?string $type = null, array $options = [])
7575
{
7676
throw new BadMethodCallException('Buttons cannot have children.');
7777
}
@@ -81,7 +81,7 @@ public function add($child, string $type = null, array $options = [])
8181
*
8282
* @throws BadMethodCallException
8383
*/
84-
public function create(string $name, string $type = null, array $options = [])
84+
public function create(string $name, ?string $type = null, array $options = [])
8585
{
8686
throw new BadMethodCallException('Buttons cannot have children.');
8787
}
@@ -221,7 +221,7 @@ public function setAttributes(array $attributes)
221221
*
222222
* @throws BadMethodCallException
223223
*/
224-
public function setDataMapper(DataMapperInterface $dataMapper = null)
224+
public function setDataMapper(?DataMapperInterface $dataMapper = null)
225225
{
226226
throw new BadMethodCallException('Buttons do not support data mappers.');
227227
}

ChoiceList/ArrayChoiceList.php

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,23 @@ final class ChoiceLoader extends AbstractStaticOption implements ChoiceLoaderInt
2929
/**
3030
* {@inheritdoc}
3131
*/
32-
public function loadChoiceList(callable $value = null): ChoiceListInterface
32+
public function loadChoiceList(?callable $value = null): ChoiceListInterface
3333
{
3434
return $this->getOption()->loadChoiceList($value);
3535
}
3636

3737
/**
3838
* {@inheritdoc}
3939
*/
40-
public function loadChoicesForValues(array $values, callable $value = null): array
40+
public function loadChoicesForValues(array $values, ?callable $value = null): array
4141
{
4242
return $this->getOption()->loadChoicesForValues($values, $value);
4343
}
4444

4545
/**
4646
* {@inheritdoc}
4747
*/
48-
public function loadValuesForChoices(array $choices, callable $value = null): array
48+
public function loadValuesForChoices(array $choices, ?callable $value = null): array
4949
{
5050
return $this->getOption()->loadValuesForChoices($choices, $value);
5151
}

ChoiceList/Factory/ChoiceListFactoryInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ interface ChoiceListFactoryInterface
3535
*
3636
* @return ChoiceListInterface
3737
*/
38-
public function createListFromChoices(iterable $choices, callable $value = null/* , callable $filter = null */);
38+
public function createListFromChoices(iterable $choices, ?callable $value = null/* , callable $filter = null */);
3939

4040
/**
4141
* Creates a choice list that is loaded with the given loader.
@@ -48,7 +48,7 @@ public function createListFromChoices(iterable $choices, callable $value = null/
4848
*
4949
* @return ChoiceListInterface
5050
*/
51-
public function createListFromLoader(ChoiceLoaderInterface $loader, callable $value = null/* , callable $filter = null */);
51+
public function createListFromLoader(ChoiceLoaderInterface $loader, ?callable $value = null/* , callable $filter = null */);
5252

5353
/**
5454
* Creates a view for the given choice list.
@@ -84,5 +84,5 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, callable $va
8484
*
8585
* @return ChoiceListView
8686
*/
87-
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, callable $index = null, callable $groupBy = null, $attr = null/* , $labelTranslationParameters = [] */);
87+
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, ?callable $index = null, ?callable $groupBy = null, $attr = null/* , $labelTranslationParameters = [] */);
8888
}

ChoiceList/Factory/DefaultChoiceListFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class DefaultChoiceListFactory implements ChoiceListFactoryInterface
3535
*
3636
* @param callable|null $filter
3737
*/
38-
public function createListFromChoices(iterable $choices, callable $value = null/* , callable $filter = null */)
38+
public function createListFromChoices(iterable $choices, ?callable $value = null/* , callable $filter = null */)
3939
{
4040
$filter = \func_num_args() > 2 ? func_get_arg(2) : null;
4141

@@ -56,7 +56,7 @@ public function createListFromChoices(iterable $choices, callable $value = null/
5656
*
5757
* @param callable|null $filter
5858
*/
59-
public function createListFromLoader(ChoiceLoaderInterface $loader, callable $value = null/* , callable $filter = null */)
59+
public function createListFromLoader(ChoiceLoaderInterface $loader, ?callable $value = null/* , callable $filter = null */)
6060
{
6161
$filter = \func_num_args() > 2 ? func_get_arg(2) : null;
6262

@@ -72,7 +72,7 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, callable $va
7272
*
7373
* @param array|callable $labelTranslationParameters The parameters used to translate the choice labels
7474
*/
75-
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, callable $index = null, callable $groupBy = null, $attr = null/* , $labelTranslationParameters = [] */)
75+
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, ?callable $index = null, ?callable $groupBy = null, $attr = null/* , $labelTranslationParameters = [] */)
7676
{
7777
$labelTranslationParameters = \func_num_args() > 6 ? func_get_arg(6) : [];
7878
$preferredViews = [];

ChoiceList/Factory/PropertyAccessDecorator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class PropertyAccessDecorator implements ChoiceListFactoryInterface
4141
private $decoratedFactory;
4242
private $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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class LazyChoiceList implements ChoiceListInterface
4747
*
4848
* @param callable|null $value The callable generating the choice values
4949
*/
50-
public function __construct(ChoiceLoaderInterface $loader, callable $value = null)
50+
public function __construct(ChoiceLoaderInterface $loader, ?callable $value = null)
5151
{
5252
$this->loader = $loader;
5353
$this->value = $value;

ChoiceList/Loader/AbstractChoiceLoader.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ abstract class AbstractChoiceLoader implements ChoiceLoaderInterface
3131
*
3232
* {@inheritdoc}
3333
*/
34-
public function loadChoiceList(callable $value = null): ChoiceListInterface
34+
public function loadChoiceList(?callable $value = null): ChoiceListInterface
3535
{
3636
return new ArrayChoiceList($this->choices ?? $this->choices = $this->loadChoices(), $value);
3737
}
3838

3939
/**
4040
* {@inheritdoc}
4141
*/
42-
public function loadChoicesForValues(array $values, callable $value = null)
42+
public function loadChoicesForValues(array $values, ?callable $value = null)
4343
{
4444
if (!$values) {
4545
return [];
@@ -51,7 +51,7 @@ public function loadChoicesForValues(array $values, callable $value = null)
5151
/**
5252
* {@inheritdoc}
5353
*/
54-
public function loadValuesForChoices(array $choices, callable $value = null)
54+
public function loadValuesForChoices(array $choices, ?callable $value = null)
5555
{
5656
if (!$choices) {
5757
return [];

ChoiceList/Loader/ChoiceLoaderInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ interface ChoiceLoaderInterface
3636
*
3737
* @return ChoiceListInterface
3838
*/
39-
public function loadChoiceList(callable $value = null);
39+
public function loadChoiceList(?callable $value = null);
4040

4141
/**
4242
* Loads the choices corresponding to the given values.
@@ -54,7 +54,7 @@ public function loadChoiceList(callable $value = null);
5454
*
5555
* @return array
5656
*/
57-
public function loadChoicesForValues(array $values, callable $value = null);
57+
public function loadChoicesForValues(array $values, ?callable $value = null);
5858

5959
/**
6060
* Loads the values corresponding to the given choices.
@@ -72,5 +72,5 @@ public function loadChoicesForValues(array $values, callable $value = null);
7272
*
7373
* @return string[]
7474
*/
75-
public function loadValuesForChoices(array $choices, callable $value = null);
75+
public function loadValuesForChoices(array $choices, ?callable $value = null);
7676
}

0 commit comments

Comments
 (0)