From 8af78e9f9bd29449ec49726c8d550fb3df0cb193 Mon Sep 17 00:00:00 2001 From: Jules Pietri Date: Thu, 24 Mar 2016 16:52:22 +0100 Subject: [PATCH] [Form] Remove unused legacy code in `ChoiceType` --- .../Form/Extension/Core/Type/ChoiceType.php | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php b/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php index 65d607077bf59..9a417673fe249 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php @@ -357,21 +357,6 @@ public function getBlockPrefix() return 'choice'; } - private static function flipRecursive($choices, &$output = array()) - { - foreach ($choices as $key => $value) { - if (is_array($value)) { - $output[$key] = array(); - self::flipRecursive($value, $output[$key]); - continue; - } - - $output[$value] = $key; - } - - return $output; - } - /** * Adds the sub fields for an expanded choice field. * @@ -447,9 +432,7 @@ private function createChoiceListView(ChoiceListInterface $choiceList, array $op // If no explicit grouping information is given, use the structural // information from the "choices" option for creating groups if (!$options['group_by'] && $options['choices']) { - $options['group_by'] = !$options['choices_as_values'] - ? self::flipRecursive($options['choices']) - : $options['choices']; + $options['group_by'] = $options['choices']; } return $this->choiceListFactory->createView( pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy