diff --git a/src/Symfony/Bridge/Twig/Extension/FormExtension.php b/src/Symfony/Bridge/Twig/Extension/FormExtension.php index 38270f9f5b..9c7339f702 100644 --- a/src/Symfony/Bridge/Twig/Extension/FormExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/FormExtension.php @@ -13,7 +13,7 @@ namespace Symfony\Bridge\Twig\Extension; use Symfony\Bridge\Twig\TokenParser\FormThemeTokenParser; use Symfony\Bridge\Twig\Form\TwigRendererInterface; -use Symfony\Component\Form\ChoiceList\View\ChoiceView; +use Symfony\Component\Form\Extension\Core\View\ChoiceView; /** * FormExtension extends Twig with form capabilities. diff --git a/src/Symfony/Component/Form/ChoiceList/View/ChoiceView.php b/src/Symfony/Component/Form/ChoiceList/View/ChoiceView.php index ded2a55b30..ddb762d4b4 100644 --- a/src/Symfony/Component/Form/ChoiceList/View/ChoiceView.php +++ b/src/Symfony/Component/Form/ChoiceList/View/ChoiceView.php @@ -11,12 +11,14 @@ namespace Symfony\Component\Form\ChoiceList\View; +use Symfony\Component\Form\Extension\Core\View\ChoiceView as LegacyChoiceView; + /** * Represents a choice in templates. * * @author Bernhard Schussek */ -class ChoiceView +class ChoiceView extends LegacyChoiceView { /** * The label displayed to humans. diff --git a/src/Symfony/Component/Form/Extension/Core/View/ChoiceView.php b/src/Symfony/Component/Form/Extension/Core/View/ChoiceView.php index 0cbeecab9f..36fdacf1fa 100644 --- a/src/Symfony/Component/Form/Extension/Core/View/ChoiceView.php +++ b/src/Symfony/Component/Form/Extension/Core/View/ChoiceView.php @@ -11,18 +11,37 @@ namespace Symfony\Component\Form\Extension\Core\View; -use Symfony\Component\Form\ChoiceList\View\ChoiceView as BaseChoiceView; - /** * Represents a choice in templates. * * @author Bernhard Schussek * * @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0. - * Use {@link BaseChoiceView} instead. + * Use {@link \Symfony\Component\Form\ChoiceList\View\ChoiceView} instead. */ -class ChoiceView extends BaseChoiceView +class ChoiceView { + /** + * The original choice value. + * + * @var mixed + */ + public $data; + + /** + * The view representation of the choice. + * + * @var string + */ + public $value; + + /** + * The label displayed to humans. + * + * @var string + */ + public $label; + /** * Creates a new ChoiceView. * @@ -32,7 +51,9 @@ class ChoiceView extends BaseChoiceView */ public function __construct($data, $value, $label) { - parent::__construct($label, $value, $data); + $this->data = $data; + $this->value = $value; + $this->label = $label; trigger_error('The '.__CLASS__.' class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\View\ChoiceView instead.', E_USER_DEPRECATED); }