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 84ba7b0

Browse filesBrowse files
committed
Improved ChoiceListViewBuilder::addView readability
1 parent 5fd6cd6 commit 84ba7b0
Copy full SHA for 84ba7b0

File tree

Expand file treeCollapse file tree

1 file changed

+4
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-7
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/ChoiceList/Factory/ChoiceListViewBuilder.php
+4-7Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,12 @@ private function addViewsFromStructuredValues(&$preferredViews, &$otherViews, Ch
194194

195195
private function addView(array &$preferredViews, array &$otherViews, $choice, $key, $value): void
196196
{
197-
$view = new ChoiceView(
198-
$choice,
199-
$value,
200-
$this->getChoiceLabel($choice, $key, $value),
201-
$this->getChoiceAttr($choice, $key, $value)
202-
);
203-
197+
$label = $this->getChoiceLabel($choice, $key, $value);
198+
$attr = $this->getChoiceAttr($choice, $key, $value);
204199
$index = $this->getChoiceIndex($choice, $key, $value);
205200

201+
$view = new ChoiceView($choice, $value, $label, $attr);
202+
206203
if ($this->isChoicePreferred($choice, $key, $value)) {
207204
$preferredViews[$index] = $view;
208205
} else {

0 commit comments

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