Skip to content

Commit 8c120f3

Browse files
Merge branch '6.0' into 6.1
* 6.0: CS fixes Bump Symfony version to 6.0.11 Update VERSION for 6.0.10 Update CHANGELOG for 6.0.10 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 e7d5c89 + d2bac01 commit 8c120f3

File tree

15 files changed

+118
-118
lines changed

15 files changed

+118
-118
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
@@ -176,7 +176,7 @@ private function getFileUploadError(int $errorCode)
176176
*/
177177
private static function getMaxFilesize(): int|float
178178
{
179-
$iniMax = strtolower(ini_get('upload_max_filesize'));
179+
$iniMax = strtolower(\ini_get('upload_max_filesize'));
180180

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

Extension/HtmlSanitizer/Type/TextTypeHtmlSanitizerExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
5656
$builder->addEventListener(
5757
FormEvents::PRE_SUBMIT,
5858
static function (FormEvent $event) use ($sanitizers, $sanitizer) {
59-
if (is_scalar($data = $event->getData()) && '' !== trim($data)) {
59+
if (\is_scalar($data = $event->getData()) && '' !== trim($data)) {
6060
$event->setData($sanitizers->get($sanitizer)->sanitize($data));
6161
}
6262
},

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')) {
@@ -1079,7 +1079,7 @@ private function normToView(mixed $value): mixed
10791079
// compound forms is passed to the data mapper and thus should
10801080
// not be converted to a string before.
10811081
if (!($transformers = $this->config->getViewTransformers()) && !$this->config->getCompound()) {
1082-
return null === $value || is_scalar($value) ? (string) $value : $value;
1082+
return null === $value || \is_scalar($value) ? (string) $value : $value;
10831083
}
10841084

10851085
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
}

0 commit comments

Comments
 (0)