Skip to content

Commit 29c4337

Browse files
Merge branch '4.4' into 5.4
* 4.4: CS fixes 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 de99efe + e7c7d1d commit 29c4337

File tree

15 files changed

+118
-119
lines changed

15 files changed

+118
-119
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
@@ -194,7 +194,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
194194
if (\count($unknownValues) > 0) {
195195
$form = $event->getForm();
196196

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

199199
if (null !== $this->translator) {
200200
$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
@@ -55,7 +55,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
5555

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

Extension/Core/Type/FileType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ private function getFileUploadError(int $errorCode)
181181
*/
182182
private static function getMaxFilesize()
183183
{
184-
$iniMax = strtolower(ini_get('upload_max_filesize'));
184+
$iniMax = strtolower(\ini_get('upload_max_filesize'));
185185

186186
if ('' === $iniMax) {
187187
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($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
@@ -356,7 +356,7 @@ public function setData($modelData)
356356
}
357357

358358
// Treat data as strings unless a transformer exists
359-
if (is_scalar($modelData) && !$this->config->getViewTransformers() && !$this->config->getModelTransformers()) {
359+
if (\is_scalar($modelData) && !$this->config->getViewTransformers() && !$this->config->getModelTransformers()) {
360360
$modelData = (string) $modelData;
361361
}
362362

@@ -539,7 +539,7 @@ public function submit($submittedData, bool $clearMissing = true)
539539
// and radio buttons with empty values.
540540
if (false === $submittedData) {
541541
$submittedData = null;
542-
} elseif (is_scalar($submittedData)) {
542+
} elseif (\is_scalar($submittedData)) {
543543
$submittedData = (string) $submittedData;
544544
} elseif ($this->config->getRequestHandler()->isFileUpload($submittedData)) {
545545
if (!$this->config->getOption('allow_file_upload')) {
@@ -1154,7 +1154,7 @@ private function normToView($value)
11541154
// compound forms is passed to the data mapper and thus should
11551155
// not be converted to a string before.
11561156
if (!($transformers = $this->config->getViewTransformers()) && !$this->config->getCompound()) {
1157-
return null === $value || is_scalar($value) ? (string) $value : $value;
1157+
return null === $value || \is_scalar($value) ? (string) $value : $value;
11581158
}
11591159

11601160
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

@@ -960,64 +960,64 @@ private function assertObjectListWithCustomValues(ChoiceListInterface $list)
960960
private function assertFlatView($view)
961961
{
962962
$this->assertEquals(new ChoiceListView(
963-
[
964-
0 => new ChoiceView($this->obj1, '0', 'A'),
965-
1 => new ChoiceView($this->obj2, '1', 'B'),
966-
2 => new ChoiceView($this->obj3, '2', 'C'),
967-
3 => new ChoiceView($this->obj4, '3', 'D'),
968-
], [
969-
1 => new ChoiceView($this->obj2, '1', 'B'),
970-
2 => new ChoiceView($this->obj3, '2', 'C'),
971-
]
963+
[
964+
0 => new ChoiceView($this->obj1, '0', 'A'),
965+
1 => new ChoiceView($this->obj2, '1', 'B'),
966+
2 => new ChoiceView($this->obj3, '2', 'C'),
967+
3 => new ChoiceView($this->obj4, '3', 'D'),
968+
], [
969+
1 => new ChoiceView($this->obj2, '1', 'B'),
970+
2 => new ChoiceView($this->obj3, '2', 'C'),
971+
]
972972
), $view);
973973
}
974974

975975
private function assertFlatViewWithCustomIndices($view)
976976
{
977977
$this->assertEquals(new ChoiceListView(
978-
[
979-
'w' => new ChoiceView($this->obj1, '0', 'A'),
980-
'x' => new ChoiceView($this->obj2, '1', 'B'),
981-
'y' => new ChoiceView($this->obj3, '2', 'C'),
982-
'z' => new ChoiceView($this->obj4, '3', 'D'),
983-
], [
984-
'x' => new ChoiceView($this->obj2, '1', 'B'),
985-
'y' => new ChoiceView($this->obj3, '2', 'C'),
986-
]
978+
[
979+
'w' => new ChoiceView($this->obj1, '0', 'A'),
980+
'x' => new ChoiceView($this->obj2, '1', 'B'),
981+
'y' => new ChoiceView($this->obj3, '2', 'C'),
982+
'z' => new ChoiceView($this->obj4, '3', 'D'),
983+
], [
984+
'x' => new ChoiceView($this->obj2, '1', 'B'),
985+
'y' => new ChoiceView($this->obj3, '2', 'C'),
986+
]
987987
), $view);
988988
}
989989

990990
private function assertFlatViewWithAttr($view)
991991
{
992992
$this->assertEquals(new ChoiceListView(
993-
[
994-
0 => new ChoiceView($this->obj1, '0', 'A'),
995-
1 => new ChoiceView(
996-
$this->obj2,
997-
'1',
998-
'B',
999-
['attr1' => 'value1']
1000-
),
1001-
2 => new ChoiceView(
1002-
$this->obj3,
1003-
'2',
1004-
'C',
1005-
['attr2' => 'value2']
1006-
),
1007-
3 => new ChoiceView($this->obj4, '3', 'D'),
1008-
], [
1009-
1 => new ChoiceView(
1010-
$this->obj2,
1011-
'1',
1012-
'B',
1013-
['attr1' => 'value1']
1014-
),
1015-
2 => new ChoiceView(
1016-
$this->obj3,
1017-
'2',
1018-
'C',
1019-
['attr2' => 'value2']
1020-
),
993+
[
994+
0 => new ChoiceView($this->obj1, '0', 'A'),
995+
1 => new ChoiceView(
996+
$this->obj2,
997+
'1',
998+
'B',
999+
['attr1' => 'value1']
1000+
),
1001+
2 => new ChoiceView(
1002+
$this->obj3,
1003+
'2',
1004+
'C',
1005+
['attr2' => 'value2']
1006+
),
1007+
3 => new ChoiceView($this->obj4, '3', 'D'),
1008+
], [
1009+
1 => new ChoiceView(
1010+
$this->obj2,
1011+
'1',
1012+
'B',
1013+
['attr1' => 'value1']
1014+
),
1015+
2 => new ChoiceView(
1016+
$this->obj3,
1017+
'2',
1018+
'C',
1019+
['attr2' => 'value2']
1020+
),
10211021
]
10221022
), $view);
10231023
}
@@ -1040,30 +1040,30 @@ private function assertFlatViewWithlabelTranslationParameters($view)
10401040
private function assertGroupedView($view)
10411041
{
10421042
$this->assertEquals(new ChoiceListView(
1043-
[
1044-
'Group 1' => new ChoiceGroupView(
1045-
'Group 1',
1046-
[
1047-
0 => new ChoiceView($this->obj1, '0', 'A'),
1048-
1 => new ChoiceView($this->obj2, '1', 'B'),
1049-
]
1050-
),
1051-
'Group 2' => new ChoiceGroupView(
1052-
'Group 2',
1053-
[
1054-
2 => new ChoiceView($this->obj3, '2', 'C'),
1055-
3 => new ChoiceView($this->obj4, '3', 'D'),
1056-
]
1057-
),
1058-
], [
1059-
'Group 1' => new ChoiceGroupView(
1060-
'Group 1',
1061-
[1 => new ChoiceView($this->obj2, '1', 'B')]
1062-
),
1063-
'Group 2' => new ChoiceGroupView(
1064-
'Group 2',
1065-
[2 => new ChoiceView($this->obj3, '2', 'C')]
1066-
),
1043+
[
1044+
'Group 1' => new ChoiceGroupView(
1045+
'Group 1',
1046+
[
1047+
0 => new ChoiceView($this->obj1, '0', 'A'),
1048+
1 => new ChoiceView($this->obj2, '1', 'B'),
1049+
]
1050+
),
1051+
'Group 2' => new ChoiceGroupView(
1052+
'Group 2',
1053+
[
1054+
2 => new ChoiceView($this->obj3, '2', 'C'),
1055+
3 => new ChoiceView($this->obj4, '3', 'D'),
1056+
]
1057+
),
1058+
], [
1059+
'Group 1' => new ChoiceGroupView(
1060+
'Group 1',
1061+
[1 => new ChoiceView($this->obj2, '1', 'B')]
1062+
),
1063+
'Group 2' => new ChoiceGroupView(
1064+
'Group 2',
1065+
[2 => new ChoiceView($this->obj3, '2', 'C')]
1066+
),
10671067
]
10681068
), $view);
10691069
}

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)