Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 50dcd1c

Browse filesBrowse files
Review
1 parent 869c3ba commit 50dcd1c
Copy full SHA for 50dcd1c

File tree

3 files changed

+6
-8
lines changed
Filter options

3 files changed

+6
-8
lines changed

‎src/Symfony/Component/Form/ChoiceList/Factory/CachingFactoryDecorator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/ChoiceList/Factory/CachingFactoryDecorator.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = nul
183183
*/
184184
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, $index = null, $groupBy = null, $attr = null/*, $labelTranslationParameters = []*/)
185185
{
186-
$labelTranslationParameters = \func_get_args()[6] ?? [];
186+
$labelTranslationParameters = \func_num_args() > 6 ? func_get_arg(6) : [];
187187
$cache = true;
188188

189189
if ($preferredChoices instanceof Cache\PreferredChoice) {

‎src/Symfony/Component/Form/ChoiceList/Factory/DefaultChoiceListFactory.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/ChoiceList/Factory/DefaultChoiceListFactory.php
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, callable $va
7373
*/
7474
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, callable $index = null, callable $groupBy = null, $attr = null/*, $labelTranslationParameters = []*/)
7575
{
76-
$labelTranslationParameters = \func_get_args()[6] ?? [];
76+
$labelTranslationParameters = \func_num_args() > 6 ? func_get_arg(6) : [];
7777
$preferredViews = [];
7878
$preferredViewsOrder = [];
7979
$otherViews = [];
@@ -191,12 +191,10 @@ private static function addChoiceView($choice, string $value, $label, array $key
191191
$label,
192192
// The attributes may be a callable or a mapping from choice indices
193193
// to nested arrays
194-
\is_callable($attr) ? $attr($choice, $key, $value) : (isset($attr[$key]) ? $attr[$key] : []),
194+
\is_callable($attr) ? $attr($choice, $key, $value) : ($attr[$key] ?? []),
195195
// The label translation parameters may be a callable or a mapping from choice indices
196196
// to nested arrays
197-
\is_callable($labelTranslationParameters)
198-
? $labelTranslationParameters($choice, $key, $value)
199-
: (isset($labelTranslationParameters[$key]) ? $labelTranslationParameters[$key] : [])
197+
\is_callable($labelTranslationParameters) ? $labelTranslationParameters($choice, $key, $value) : ($labelTranslationParameters[$key] ?? [])
200198
);
201199

202200
// $isPreferred may be null if no choices are preferred

‎src/Symfony/Component/Form/ChoiceList/Factory/PropertyAccessDecorator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/ChoiceList/Factory/PropertyAccessDecorator.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = nul
156156
*/
157157
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, $index = null, $groupBy = null, $attr = null/*, $labelTranslationParameters = []*/)
158158
{
159-
$labelTranslationParameters = \func_get_args()[6] ?? [];
159+
$labelTranslationParameters = \func_num_args() > 6 ? func_get_arg(6) : [];
160160
$accessor = $this->propertyAccessor;
161161

162162
if (\is_string($label)) {
@@ -224,7 +224,7 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
224224
}
225225

226226
if ($labelTranslationParameters instanceof PropertyPath) {
227-
$labelTranslationParameters = function ($choice) use ($accessor, $labelTranslationParameters) {
227+
$labelTranslationParameters = static function ($choice) use ($accessor, $labelTranslationParameters) {
228228
return $accessor->getValue($choice, $labelTranslationParameters);
229229
};
230230
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.