Skip to content

Commit 45a8ce0

Browse files
Merge branch '7.4' into 8.0
* 7.4: [SecurityBundle] Fix tests on Windows use the empty string instead of null as an array offset pass the empty string instead of null as key to array_key_exists() fix test setup [Validator] Review Turkish translations [Validator] Review Croatian translations [Console] Add #[Input] attribute to support DTOs in commands [Security][SecurityBundle] Dump role hierarchy as mermaid chart [DependencyInjection] Allow `Class::function(...)` and `global_function(...)` closures in PHP DSL for factories [VarExporter] Add support for exporting named closures [Validator] Review translations for Polish (pl) use the empty string instead of null as an array offset Review translations for Chinese (zh_TW) [Serializer] Adjust ObjectNormalizerTest for the accessor method changes from #61097 fix merge [Security] Fix `HttpUtils::createRequest()` when the base request is forwarded map legacy options to the "sentinel" key when parsing DSNs fix setup to actually run Redis Sentinel/Cluster integration tests [Routing] Don't rebuild cache when controller action body changes
2 parents 1602f6d + 9e63e78 commit 45a8ce0

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

ChoiceList/ArrayChoiceList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function getChoicesForValues(array $values): array
105105
$choices = [];
106106

107107
foreach ($values as $i => $givenValue) {
108-
if (\array_key_exists($givenValue, $this->choices)) {
108+
if (\array_key_exists($givenValue ?? '', $this->choices)) {
109109
$choices[$i] = $this->choices[$givenValue];
110110
}
111111
}

Tests/Fixtures/FixedDataTransformer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public function __construct(array $mapping)
2525

2626
public function transform($value): mixed
2727
{
28+
$value ??= '';
2829
if (!\array_key_exists($value, $this->mapping)) {
2930
throw new TransformationFailedException(\sprintf('No mapping for value "%s"', $value));
3031
}

Tests/Fixtures/FixedFilterListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public function preSetData(FormEvent $event)
5050
{
5151
$data = $event->getData();
5252

53-
if (isset($this->mapping['preSetData'][$data])) {
54-
$event->setData($this->mapping['preSetData'][$data]);
53+
if (isset($this->mapping['preSetData'][$data ?? ''])) {
54+
$event->setData($this->mapping['preSetData'][$data ?? '']);
5555
}
5656
}
5757

0 commit comments

Comments
 (0)