Skip to content

Commit d2bac01

Browse files
Merge branch '5.4' into 6.0
* 5.4: CS fixes Bump Symfony version to 5.4.11 Update VERSION for 5.4.10 Update CHANGELOG for 5.4.10 Bump Symfony version to 4.4.44 Update VERSION for 4.4.43 Update CONTRIBUTORS for 4.4.43 Update CHANGELOG for 4.4.43
2 parents 6f280b4 + 29c4337 commit d2bac01

File tree

14 files changed

+117
-117
lines changed

14 files changed

+117
-117
lines changed

ChoiceList/ArrayChoiceList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ private function castableToString(array $choices, array &$cache = []): bool
219219
}
220220

221221
continue;
222-
} elseif (!is_scalar($choice)) {
222+
} elseif (!\is_scalar($choice)) {
223223
return false;
224224
}
225225

ChoiceList/Loader/FilterChoiceLoaderDecorator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected function loadChoices(): iterable
3636
}
3737

3838
foreach ($structuredValues as $group => $values) {
39-
if (is_array($values)) {
39+
if (\is_array($values)) {
4040
if ($values && $filtered = array_filter($list->getChoicesForValues($values), $this->filter)) {
4141
$choices[$group] = $filtered;
4242
}

Extension/Core/EventListener/TransformationFailureListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function convertTransformationFailureToFormError(FormEvent $event)
5050
}
5151
}
5252

53-
$clientDataAsString = is_scalar($form->getViewData()) ? (string) $form->getViewData() : get_debug_type($form->getViewData());
53+
$clientDataAsString = \is_scalar($form->getViewData()) ? (string) $form->getViewData() : get_debug_type($form->getViewData());
5454
$messageTemplate = $form->getConfig()->getOption('invalid_message', 'The value {{ value }} is not valid.');
5555
$messageParameters = array_replace(['{{ value }}' => $clientDataAsString], $form->getConfig()->getOption('invalid_message_parameters', []));
5656

Extension/Core/Type/ChoiceType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
176176
if (\count($unknownValues) > 0) {
177177
$form = $event->getForm();
178178

179-
$clientDataAsString = is_scalar($form->getViewData()) ? (string) $form->getViewData() : (\is_array($form->getViewData()) ? implode('", "', array_keys($unknownValues)) : \gettype($form->getViewData()));
179+
$clientDataAsString = \is_scalar($form->getViewData()) ? (string) $form->getViewData() : (\is_array($form->getViewData()) ? implode('", "', array_keys($unknownValues)) : \gettype($form->getViewData()));
180180

181181
if (null !== $this->translator) {
182182
$message = $this->translator->trans($messageTemplate, ['{{ value }}' => $clientDataAsString], 'validators');

Extension/Core/Type/ColorType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
5454

5555
$messageTemplate = 'This value is not a valid HTML5 color.';
5656
$messageParameters = [
57-
'{{ value }}' => is_scalar($value) ? (string) $value : \gettype($value),
57+
'{{ value }}' => \is_scalar($value) ? (string) $value : \gettype($value),
5858
];
5959
$message = $this->translator ? $this->translator->trans($messageTemplate, $messageParameters, 'validators') : $messageTemplate;
6060

Extension/Core/Type/FileType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ private function getFileUploadError(int $errorCode)
175175
*/
176176
private static function getMaxFilesize(): int|float
177177
{
178-
$iniMax = strtolower(ini_get('upload_max_filesize'));
178+
$iniMax = strtolower(\ini_get('upload_max_filesize'));
179179

180180
if ('' === $iniMax) {
181181
return \PHP_INT_MAX;

Extension/Validator/Constraints/FormValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function validate(mixed $form, Constraint $formConstraint)
171171
// child.
172172
// See also https://github.com/symfony/symfony/issues/4359
173173
if ($childrenSynchronized) {
174-
$clientDataAsString = is_scalar($form->getViewData())
174+
$clientDataAsString = \is_scalar($form->getViewData())
175175
? (string) $form->getViewData()
176176
: get_debug_type($form->getViewData());
177177

Form.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ public function setData(mixed $modelData): static
317317
}
318318

319319
// Treat data as strings unless a transformer exists
320-
if (is_scalar($modelData) && !$this->config->getViewTransformers() && !$this->config->getModelTransformers()) {
320+
if (\is_scalar($modelData) && !$this->config->getViewTransformers() && !$this->config->getModelTransformers()) {
321321
$modelData = (string) $modelData;
322322
}
323323

@@ -500,7 +500,7 @@ public function submit(mixed $submittedData, bool $clearMissing = true): static
500500
// and radio buttons with empty values.
501501
if (false === $submittedData) {
502502
$submittedData = null;
503-
} elseif (is_scalar($submittedData)) {
503+
} elseif (\is_scalar($submittedData)) {
504504
$submittedData = (string) $submittedData;
505505
} elseif ($this->config->getRequestHandler()->isFileUpload($submittedData)) {
506506
if (!$this->config->getOption('allow_file_upload')) {
@@ -1083,7 +1083,7 @@ private function normToView(mixed $value): mixed
10831083
// compound forms is passed to the data mapper and thus should
10841084
// not be converted to a string before.
10851085
if (!($transformers = $this->config->getViewTransformers()) && !$this->config->getCompound()) {
1086-
return null === $value || is_scalar($value) ? (string) $value : $value;
1086+
return null === $value || \is_scalar($value) ? (string) $value : $value;
10871087
}
10881088

10891089
try {

Tests/ChoiceList/Factory/DefaultChoiceListFactoryTest.php

Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,12 @@ public function testCreateViewFlat()
285285
$view = $this->factory->createView($this->list);
286286

287287
$this->assertEquals(new ChoiceListView(
288-
[
289-
0 => new ChoiceView($this->obj1, '0', 'A'),
290-
1 => new ChoiceView($this->obj2, '1', 'B'),
291-
2 => new ChoiceView($this->obj3, '2', 'C'),
292-
3 => new ChoiceView($this->obj4, '3', 'D'),
293-
], []
288+
[
289+
0 => new ChoiceView($this->obj1, '0', 'A'),
290+
1 => new ChoiceView($this->obj2, '1', 'B'),
291+
2 => new ChoiceView($this->obj3, '2', 'C'),
292+
3 => new ChoiceView($this->obj4, '3', 'D'),
293+
], []
294294
), $view);
295295
}
296296

@@ -365,12 +365,12 @@ public function testCreateViewFlatPreferredChoicesEmptyArray()
365365
);
366366

367367
$this->assertEquals(new ChoiceListView(
368-
[
369-
0 => new ChoiceView($this->obj1, '0', 'A'),
370-
1 => new ChoiceView($this->obj2, '1', 'B'),
371-
2 => new ChoiceView($this->obj3, '2', 'C'),
372-
3 => new ChoiceView($this->obj4, '3', 'D'),
373-
], []
368+
[
369+
0 => new ChoiceView($this->obj1, '0', 'A'),
370+
1 => new ChoiceView($this->obj2, '1', 'B'),
371+
2 => new ChoiceView($this->obj3, '2', 'C'),
372+
3 => new ChoiceView($this->obj4, '3', 'D'),
373+
], []
374374
), $view);
375375
}
376376

@@ -957,64 +957,64 @@ private function assertObjectListWithCustomValues(ChoiceListInterface $list)
957957
private function assertFlatView($view)
958958
{
959959
$this->assertEquals(new ChoiceListView(
960-
[
961-
0 => new ChoiceView($this->obj1, '0', 'A'),
962-
1 => new ChoiceView($this->obj2, '1', 'B'),
963-
2 => new ChoiceView($this->obj3, '2', 'C'),
964-
3 => new ChoiceView($this->obj4, '3', 'D'),
965-
], [
966-
1 => new ChoiceView($this->obj2, '1', 'B'),
967-
2 => new ChoiceView($this->obj3, '2', 'C'),
968-
]
960+
[
961+
0 => new ChoiceView($this->obj1, '0', 'A'),
962+
1 => new ChoiceView($this->obj2, '1', 'B'),
963+
2 => new ChoiceView($this->obj3, '2', 'C'),
964+
3 => new ChoiceView($this->obj4, '3', 'D'),
965+
], [
966+
1 => new ChoiceView($this->obj2, '1', 'B'),
967+
2 => new ChoiceView($this->obj3, '2', 'C'),
968+
]
969969
), $view);
970970
}
971971

972972
private function assertFlatViewWithCustomIndices($view)
973973
{
974974
$this->assertEquals(new ChoiceListView(
975-
[
976-
'w' => new ChoiceView($this->obj1, '0', 'A'),
977-
'x' => new ChoiceView($this->obj2, '1', 'B'),
978-
'y' => new ChoiceView($this->obj3, '2', 'C'),
979-
'z' => new ChoiceView($this->obj4, '3', 'D'),
980-
], [
981-
'x' => new ChoiceView($this->obj2, '1', 'B'),
982-
'y' => new ChoiceView($this->obj3, '2', 'C'),
983-
]
975+
[
976+
'w' => new ChoiceView($this->obj1, '0', 'A'),
977+
'x' => new ChoiceView($this->obj2, '1', 'B'),
978+
'y' => new ChoiceView($this->obj3, '2', 'C'),
979+
'z' => new ChoiceView($this->obj4, '3', 'D'),
980+
], [
981+
'x' => new ChoiceView($this->obj2, '1', 'B'),
982+
'y' => new ChoiceView($this->obj3, '2', 'C'),
983+
]
984984
), $view);
985985
}
986986

987987
private function assertFlatViewWithAttr($view)
988988
{
989989
$this->assertEquals(new ChoiceListView(
990-
[
991-
0 => new ChoiceView($this->obj1, '0', 'A'),
992-
1 => new ChoiceView(
993-
$this->obj2,
994-
'1',
995-
'B',
996-
['attr1' => 'value1']
997-
),
998-
2 => new ChoiceView(
999-
$this->obj3,
1000-
'2',
1001-
'C',
1002-
['attr2' => 'value2']
1003-
),
1004-
3 => new ChoiceView($this->obj4, '3', 'D'),
1005-
], [
1006-
1 => new ChoiceView(
1007-
$this->obj2,
1008-
'1',
1009-
'B',
1010-
['attr1' => 'value1']
1011-
),
1012-
2 => new ChoiceView(
1013-
$this->obj3,
1014-
'2',
1015-
'C',
1016-
['attr2' => 'value2']
1017-
),
990+
[
991+
0 => new ChoiceView($this->obj1, '0', 'A'),
992+
1 => new ChoiceView(
993+
$this->obj2,
994+
'1',
995+
'B',
996+
['attr1' => 'value1']
997+
),
998+
2 => new ChoiceView(
999+
$this->obj3,
1000+
'2',
1001+
'C',
1002+
['attr2' => 'value2']
1003+
),
1004+
3 => new ChoiceView($this->obj4, '3', 'D'),
1005+
], [
1006+
1 => new ChoiceView(
1007+
$this->obj2,
1008+
'1',
1009+
'B',
1010+
['attr1' => 'value1']
1011+
),
1012+
2 => new ChoiceView(
1013+
$this->obj3,
1014+
'2',
1015+
'C',
1016+
['attr2' => 'value2']
1017+
),
10181018
]
10191019
), $view);
10201020
}
@@ -1037,30 +1037,30 @@ private function assertFlatViewWithlabelTranslationParameters($view)
10371037
private function assertGroupedView($view)
10381038
{
10391039
$this->assertEquals(new ChoiceListView(
1040-
[
1041-
'Group 1' => new ChoiceGroupView(
1042-
'Group 1',
1043-
[
1044-
0 => new ChoiceView($this->obj1, '0', 'A'),
1045-
1 => new ChoiceView($this->obj2, '1', 'B'),
1046-
]
1047-
),
1048-
'Group 2' => new ChoiceGroupView(
1049-
'Group 2',
1050-
[
1051-
2 => new ChoiceView($this->obj3, '2', 'C'),
1052-
3 => new ChoiceView($this->obj4, '3', 'D'),
1053-
]
1054-
),
1055-
], [
1056-
'Group 1' => new ChoiceGroupView(
1057-
'Group 1',
1058-
[1 => new ChoiceView($this->obj2, '1', 'B')]
1059-
),
1060-
'Group 2' => new ChoiceGroupView(
1061-
'Group 2',
1062-
[2 => new ChoiceView($this->obj3, '2', 'C')]
1063-
),
1040+
[
1041+
'Group 1' => new ChoiceGroupView(
1042+
'Group 1',
1043+
[
1044+
0 => new ChoiceView($this->obj1, '0', 'A'),
1045+
1 => new ChoiceView($this->obj2, '1', 'B'),
1046+
]
1047+
),
1048+
'Group 2' => new ChoiceGroupView(
1049+
'Group 2',
1050+
[
1051+
2 => new ChoiceView($this->obj3, '2', 'C'),
1052+
3 => new ChoiceView($this->obj4, '3', 'D'),
1053+
]
1054+
),
1055+
], [
1056+
'Group 1' => new ChoiceGroupView(
1057+
'Group 1',
1058+
[1 => new ChoiceView($this->obj2, '1', 'B')]
1059+
),
1060+
'Group 2' => new ChoiceGroupView(
1061+
'Group 2',
1062+
[2 => new ChoiceView($this->obj3, '2', 'C')]
1063+
),
10641064
]
10651065
), $view);
10661066
}

Tests/CompoundFormTest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -806,9 +806,9 @@ public function testGetErrors()
806806
$errors = $this->form->getErrors();
807807

808808
$this->assertSame(
809-
"ERROR: Error 1\n".
810-
"ERROR: Error 2\n",
811-
(string) $errors
809+
"ERROR: Error 1\n".
810+
"ERROR: Error 2\n",
811+
(string) $errors
812812
);
813813

814814
$this->assertSame([$error1, $error2], iterator_to_array($errors));
@@ -826,15 +826,15 @@ public function testGetErrorsDeep()
826826
$errors = $this->form->getErrors(true);
827827

828828
$this->assertSame(
829-
"ERROR: Error 1\n".
830-
"ERROR: Error 2\n".
831-
"ERROR: Nested Error\n",
832-
(string) $errors
829+
"ERROR: Error 1\n".
830+
"ERROR: Error 2\n".
831+
"ERROR: Nested Error\n",
832+
(string) $errors
833833
);
834834

835835
$this->assertSame(
836-
[$error1, $error2, $nestedError],
837-
iterator_to_array($errors)
836+
[$error1, $error2, $nestedError],
837+
iterator_to_array($errors)
838838
);
839839
}
840840

@@ -850,11 +850,11 @@ public function testGetErrorsDeepRecursive()
850850
$errors = $this->form->getErrors(true, false);
851851

852852
$this->assertSame(
853-
"ERROR: Error 1\n".
854-
"ERROR: Error 2\n".
855-
"Child:\n".
856-
" ERROR: Nested Error\n",
857-
(string) $errors
853+
"ERROR: Error 1\n".
854+
"ERROR: Error 2\n".
855+
"Child:\n".
856+
" ERROR: Nested Error\n",
857+
(string) $errors
858858
);
859859

860860
$errorsAsArray = iterator_to_array($errors);

0 commit comments

Comments
 (0)