1 | <?php |
||
23 | class ChoiceFieldMaskType extends AbstractType |
||
24 | { |
||
25 | /** |
||
26 | * {@inheritdoc} |
||
27 | */ |
||
28 | public function buildView(FormView $view, FormInterface $form, array $options): void |
||
29 | { |
||
30 | $allFieldNames = []; |
||
31 | foreach ($options['map'] as $value => $fieldNames) { |
||
32 | foreach ($fieldNames as $fieldName) { |
||
33 | $allFieldNames[$fieldName] = $fieldName; |
||
34 | } |
||
35 | } |
||
36 | $allFieldNames = array_values($allFieldNames); |
||
37 | |||
38 | $view->vars['all_fields'] = $allFieldNames; |
||
39 | $view->vars['map'] = $options['map']; |
||
40 | parent::buildView($view, $form, $options); |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * NEXT_MAJOR: remove this method. |
||
45 | */ |
||
46 | public function setDefaultOptions(OptionsResolverInterface $resolver): void |
||
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | */ |
||
54 | public function configureOptions(OptionsResolver $resolver): void |
||
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | public function getParent() |
||
68 | |||
69 | /** |
||
70 | * NEXT_MAJOR: remove this method. |
||
71 | */ |
||
72 | public function getName() |
||
76 | |||
77 | /** |
||
78 | * {@inheritdoc} |
||
79 | */ |
||
80 | public function getBlockPrefix() |
||
84 | } |
||
85 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: