Skip to content

Commit 4973f43

Browse files
Add missing return types to tests/internal/final methods
1 parent be4ba59 commit 4973f43

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

ChoiceList/Factory/Cache/ChoiceLoader.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Form\ChoiceList\Factory\Cache;
1313

14+
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
1415
use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface;
1516
use Symfony\Component\Form\FormTypeExtensionInterface;
1617
use Symfony\Component\Form\FormTypeInterface;
@@ -28,23 +29,23 @@ final class ChoiceLoader extends AbstractStaticOption implements ChoiceLoaderInt
2829
/**
2930
* {@inheritdoc}
3031
*/
31-
public function loadChoiceList(callable $value = null)
32+
public function loadChoiceList(callable $value = null): ChoiceListInterface
3233
{
3334
return $this->getOption()->loadChoiceList($value);
3435
}
3536

3637
/**
3738
* {@inheritdoc}
3839
*/
39-
public function loadChoicesForValues(array $values, callable $value = null)
40+
public function loadChoicesForValues(array $values, callable $value = null): array
4041
{
4142
return $this->getOption()->loadChoicesForValues($values, $value);
4243
}
4344

4445
/**
4546
* {@inheritdoc}
4647
*/
47-
public function loadValuesForChoices(array $choices, callable $value = null)
48+
public function loadValuesForChoices(array $choices, callable $value = null): array
4849
{
4950
return $this->getOption()->loadValuesForChoices($choices, $value);
5051
}

ChoiceList/Loader/AbstractChoiceLoader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Form\ChoiceList\Loader;
1313

1414
use Symfony\Component\Form\ChoiceList\ArrayChoiceList;
15+
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
1516

1617
/**
1718
* @author Jules Pietri <[email protected]>
@@ -30,7 +31,7 @@ abstract class AbstractChoiceLoader implements ChoiceLoaderInterface
3031
*
3132
* {@inheritdoc}
3233
*/
33-
public function loadChoiceList(callable $value = null)
34+
public function loadChoiceList(callable $value = null): ChoiceListInterface
3435
{
3536
return $this->choiceList ?? ($this->choiceList = new ArrayChoiceList($this->loadChoices(), $value));
3637
}

Tests/Fixtures/ChoiceList/DeprecatedChoiceListFactory.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,19 @@
55
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
66
use Symfony\Component\Form\ChoiceList\Factory\ChoiceListFactoryInterface;
77
use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface;
8+
use Symfony\Component\Form\ChoiceList\View\ChoiceListView;
89

910
class DeprecatedChoiceListFactory implements ChoiceListFactoryInterface
1011
{
11-
public function createListFromChoices(iterable $choices, callable $value = null)
12+
public function createListFromChoices(iterable $choices, callable $value = null): ChoiceListInterface
1213
{
1314
}
1415

15-
public function createListFromLoader(ChoiceLoaderInterface $loader, callable $value = null)
16+
public function createListFromLoader(ChoiceLoaderInterface $loader, callable $value = null): ChoiceListInterface
1617
{
1718
}
1819

19-
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, callable $index = null, callable $groupBy = null, $attr = null)
20+
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, callable $index = null, callable $groupBy = null, $attr = null): ChoiceListView
2021
{
2122
}
2223
}

0 commit comments

Comments
 (0)