Skip to content

Commit f94d6c6

Browse files
wouterjnicolas-grekas
authored andcommitted
Add void return types
1 parent 0157ef6 commit f94d6c6

File tree

79 files changed

+399
-19
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

+399
-19
lines changed

AbstractExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ protected function loadTypeGuesser()
128128
*
129129
* @throws UnexpectedTypeException if any registered type is not an instance of FormTypeInterface
130130
*/
131-
private function initTypes()
131+
private function initTypes(): void
132132
{
133133
$this->types = [];
134134

@@ -147,7 +147,7 @@ private function initTypes()
147147
* @throws UnexpectedTypeException if any registered type extension is not
148148
* an instance of FormTypeExtensionInterface
149149
*/
150-
private function initTypeExtensions()
150+
private function initTypeExtensions(): void
151151
{
152152
$this->typeExtensions = [];
153153

@@ -167,7 +167,7 @@ private function initTypeExtensions()
167167
*
168168
* @throws UnexpectedTypeException if the type guesser is not an instance of FormTypeGuesserInterface
169169
*/
170-
private function initTypeGuesser()
170+
private function initTypeGuesser(): void
171171
{
172172
$this->typeGuesserLoaded = true;
173173

AbstractRendererEngine.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ public function __construct(array $defaultThemes = [])
6161
$this->defaultThemes = $defaultThemes;
6262
}
6363

64+
/**
65+
* @return void
66+
*/
6467
public function setTheme(FormView $view, mixed $themes, bool $useDefaultThemes = true)
6568
{
6669
$cacheKey = $view->vars[self::CACHE_KEY_VAR];

AbstractType.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,30 @@
2020
*/
2121
abstract class AbstractType implements FormTypeInterface
2222
{
23+
/**
24+
* @return void
25+
*/
2326
public function buildForm(FormBuilderInterface $builder, array $options)
2427
{
2528
}
2629

30+
/**
31+
* @return void
32+
*/
2733
public function buildView(FormView $view, FormInterface $form, array $options)
2834
{
2935
}
3036

37+
/**
38+
* @return void
39+
*/
3140
public function finishView(FormView $view, FormInterface $form, array $options)
3241
{
3342
}
3443

44+
/**
45+
* @return void
46+
*/
3547
public function configureOptions(OptionsResolver $resolver)
3648
{
3749
}

AbstractTypeExtension.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,30 @@
1818
*/
1919
abstract class AbstractTypeExtension implements FormTypeExtensionInterface
2020
{
21+
/**
22+
* @return void
23+
*/
2124
public function buildForm(FormBuilderInterface $builder, array $options)
2225
{
2326
}
2427

28+
/**
29+
* @return void
30+
*/
2531
public function buildView(FormView $view, FormInterface $form, array $options)
2632
{
2733
}
2834

35+
/**
36+
* @return void
37+
*/
2938
public function finishView(FormView $view, FormInterface $form, array $options)
3039
{
3140
}
3241

42+
/**
43+
* @return void
44+
*/
3345
public function configureOptions(OptionsResolver $resolver)
3446
{
3547
}

ChoiceList/ArrayChoiceList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public function getValuesForChoices(array $choices): array
162162
*
163163
* @internal
164164
*/
165-
protected function flatten(array $choices, callable $value, ?array &$choicesByValues, ?array &$keysByValues, ?array &$structuredValues)
165+
protected function flatten(array $choices, callable $value, ?array &$choicesByValues, ?array &$keysByValues, ?array &$structuredValues): void
166166
{
167167
if (null === $choicesByValues) {
168168
$choicesByValues = [];

ChoiceList/Factory/CachingFactoryDecorator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ public function createView(ChoiceListInterface $list, mixed $preferredChoices =
214214
return $this->views[$hash];
215215
}
216216

217+
/**
218+
* @return void
219+
*/
217220
public function reset()
218221
{
219222
$this->lists = [];

ChoiceList/Factory/DefaultChoiceListFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function createView(ChoiceListInterface $list, array|callable $preferredC
140140
return new ChoiceListView($otherViews, $preferredViews);
141141
}
142142

143-
private static function addChoiceView($choice, string $value, $label, array $keys, &$index, $attr, $labelTranslationParameters, ?callable $isPreferred, array &$preferredViews, array &$preferredViewsOrder, array &$otherViews)
143+
private static function addChoiceView($choice, string $value, $label, array $keys, &$index, $attr, $labelTranslationParameters, ?callable $isPreferred, array &$preferredViews, array &$preferredViewsOrder, array &$otherViews): void
144144
{
145145
// $value may be an integer or a string, since it's stored in the array
146146
// keys. We want to guarantee it's a string though.
@@ -186,7 +186,7 @@ private static function addChoiceView($choice, string $value, $label, array $key
186186
$otherViews[$nextIndex] = $view;
187187
}
188188

189-
private static function addChoiceViewsFromStructuredValues(array $values, $label, array $choices, array $keys, &$index, $attr, $labelTranslationParameters, ?callable $isPreferred, array &$preferredViews, array &$preferredViewsOrder, array &$otherViews)
189+
private static function addChoiceViewsFromStructuredValues(array $values, $label, array $choices, array $keys, &$index, $attr, $labelTranslationParameters, ?callable $isPreferred, array &$preferredViews, array &$preferredViewsOrder, array &$otherViews): void
190190
{
191191
foreach ($values as $key => $value) {
192192
if (null === $value) {
@@ -240,7 +240,7 @@ private static function addChoiceViewsFromStructuredValues(array $values, $label
240240
}
241241
}
242242

243-
private static function addChoiceViewsGroupedByCallable(callable $groupBy, $choice, string $value, $label, array $keys, &$index, $attr, $labelTranslationParameters, ?callable $isPreferred, array &$preferredViews, array &$preferredViewsOrder, array &$otherViews)
243+
private static function addChoiceViewsGroupedByCallable(callable $groupBy, $choice, string $value, $label, array $keys, &$index, $attr, $labelTranslationParameters, ?callable $isPreferred, array &$preferredViews, array &$preferredViewsOrder, array &$otherViews): void
244244
{
245245
$groupLabels = $groupBy($choice, $keys[$value], $value);
246246

Command/DebugCommand.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ public function __construct(FormRegistryInterface $formRegistry, array $namespac
5454
$this->fileLinkFormatter = $fileLinkFormatter;
5555
}
5656

57+
/**
58+
* @return void
59+
*/
5760
protected function configure()
5861
{
5962
$this

DependencyInjection/FormPass.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class FormPass implements CompilerPassInterface
3030
{
3131
use PriorityTaggedServiceTrait;
3232

33+
/**
34+
* @return void
35+
*/
3336
public function process(ContainerBuilder $container)
3437
{
3538
if (!$container->hasDefinition('form.extension')) {

Extension/Core/DataMapper/CheckboxListMapper.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
*/
2626
class CheckboxListMapper implements DataMapperInterface
2727
{
28+
/**
29+
* @return void
30+
*/
2831
public function mapDataToForms(mixed $choices, \Traversable $checkboxes)
2932
{
3033
if (!\is_array($choices ??= [])) {
@@ -37,6 +40,9 @@ public function mapDataToForms(mixed $choices, \Traversable $checkboxes)
3740
}
3841
}
3942

43+
/**
44+
* @return void
45+
*/
4046
public function mapFormsToData(\Traversable $checkboxes, mixed &$choices)
4147
{
4248
if (!\is_array($choices)) {

0 commit comments

Comments
 (0)