Skip to content

Commit 347b51a

Browse files
[Form] fix missing static closure
1 parent fdbd4c1 commit 347b51a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ public function __construct(iterable $choices, callable $value = null)
6464
}
6565

6666
if (null === $value && $this->castableToString($choices)) {
67-
$value = fn ($choice) => false === $choice ? '0' : (string) $choice;
67+
$value = static fn ($choice) => false === $choice ? '0' : (string) $choice;
6868
}
6969

7070
if (null !== $value) {
7171
// If a deterministic value generator was passed, use it later
7272
$this->valueCallback = $value;
7373
} else {
7474
// Otherwise generate incrementing integers as values
75-
$value = function () {
75+
$value = static function () {
7676
static $i = 0;
7777

7878
return $i++;

0 commit comments

Comments
 (0)