From 360711ce4e3b83251e7fe9dac958dc4f4246c0b6 Mon Sep 17 00:00:00 2001 From: Valentin Udaltsov Date: Mon, 5 Aug 2019 13:00:54 +0300 Subject: [PATCH] [Form] Fix inconsistencies --- .../Component/Form/ChoiceList/ArrayChoiceList.php | 14 +++++++------- .../Factory/ChoiceListFactoryInterface.php | 8 ++------ .../Component/Form/ChoiceList/View/ChoiceView.php | 8 ++++---- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php b/src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php index e7ebc7200bd6..94c9422eecca 100644 --- a/src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php +++ b/src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php @@ -172,13 +172,13 @@ public function getValuesForChoices(array $choices) /** * Flattens an array into the given output variables. * - * @param array $choices The array to flatten - * @param callable $value The callable for generating choice values - * @param array $choicesByValues The flattened choices indexed by the - * corresponding values - * @param array $keysByValues The original keys indexed by the - * corresponding values - * @param array $structuredValues The values indexed by the original keys + * @param array $choices The array to flatten + * @param callable $value The callable for generating choice values + * @param array|null $choicesByValues The flattened choices indexed by the + * corresponding values + * @param array|null $keysByValues The original keys indexed by the + * corresponding values + * @param array|null $structuredValues The values indexed by the original keys * * @internal */ diff --git a/src/Symfony/Component/Form/ChoiceList/Factory/ChoiceListFactoryInterface.php b/src/Symfony/Component/Form/ChoiceList/Factory/ChoiceListFactoryInterface.php index 41a22586cc3b..ac6c3bcfa34d 100644 --- a/src/Symfony/Component/Form/ChoiceList/Factory/ChoiceListFactoryInterface.php +++ b/src/Symfony/Component/Form/ChoiceList/Factory/ChoiceListFactoryInterface.php @@ -32,8 +32,7 @@ interface ChoiceListFactoryInterface * Null may be passed when the choice list contains the empty value. * * @param iterable $choices The choices - * @param callable|null $value The callable generating the choice - * values + * @param callable|null $value The callable generating the choice values * * @return ChoiceListInterface The choice list */ @@ -46,9 +45,7 @@ public function createListFromChoices($choices, $value = null); * The callable receives the choice as only argument. * Null may be passed when the choice list contains the empty value. * - * @param ChoiceLoaderInterface $loader The choice loader - * @param callable|null $value The callable generating the choice - * values + * @param callable|null $value The callable generating the choice values * * @return ChoiceListInterface The choice list */ @@ -80,7 +77,6 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = nul * match the keys of the choices. The values should be arrays of HTML * attributes that should be added to the respective choice. * - * @param ChoiceListInterface $list The choice list * @param array|callable|null $preferredChoices The preferred choices * @param callable|null $label The callable generating the * choice labels diff --git a/src/Symfony/Component/Form/ChoiceList/View/ChoiceView.php b/src/Symfony/Component/Form/ChoiceList/View/ChoiceView.php index 83326a7ac128..9eb2f7c3cb8b 100644 --- a/src/Symfony/Component/Form/ChoiceList/View/ChoiceView.php +++ b/src/Symfony/Component/Form/ChoiceList/View/ChoiceView.php @@ -30,10 +30,10 @@ class ChoiceView /** * Creates a new choice view. * - * @param mixed $data The original choice - * @param string $value The view representation of the choice - * @param string $label The label displayed to humans - * @param array $attr Additional attributes for the HTML tag + * @param mixed $data The original choice + * @param string $value The view representation of the choice + * @param string|false $label The label displayed to humans; pass false to discard the label + * @param array $attr Additional attributes for the HTML tag */ public function __construct($data, $value, $label, array $attr = []) {