From 56900d2b24da18539378b888a53a488a9540d289 Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Sat, 26 Jun 2021 20:16:56 +0200 Subject: [PATCH] [Form] better form doc types to support static analysis --- src/Symfony/Component/Form/FormBuilderInterface.php | 10 +++++++--- src/Symfony/Component/Form/FormConfigInterface.php | 2 +- src/Symfony/Component/Form/FormTypeInterface.php | 6 ++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Form/FormBuilderInterface.php b/src/Symfony/Component/Form/FormBuilderInterface.php index 902fa0f950..36386bb001 100644 --- a/src/Symfony/Component/Form/FormBuilderInterface.php +++ b/src/Symfony/Component/Form/FormBuilderInterface.php @@ -13,6 +13,8 @@ namespace Symfony\Component\Form; /** * @author Bernhard Schussek + * + * @extends \Traversable */ interface FormBuilderInterface extends \Traversable, \Countable, FormConfigBuilderInterface { @@ -25,6 +27,7 @@ interface FormBuilderInterface extends \Traversable, \Countable, FormConfigBuild * * @param string|FormBuilderInterface $child * @param string|null $type + * @param array $options * * @return self */ @@ -33,8 +36,9 @@ interface FormBuilderInterface extends \Traversable, \Countable, FormConfigBuild /** * Creates a form builder. * - * @param string $name The name of the form or the name of the property - * @param string|null $type The type of the form or null if name is a property + * @param string $name The name of the form or the name of the property + * @param string|null $type The type of the form or null if name is a property + * @param array $options * * @return self */ @@ -72,7 +76,7 @@ interface FormBuilderInterface extends \Traversable, \Countable, FormConfigBuild /** * Returns the children. * - * @return array + * @return array */ public function all(); diff --git a/src/Symfony/Component/Form/FormConfigInterface.php b/src/Symfony/Component/Form/FormConfigInterface.php index 7dbda33033..43fef38911 100644 --- a/src/Symfony/Component/Form/FormConfigInterface.php +++ b/src/Symfony/Component/Form/FormConfigInterface.php @@ -229,7 +229,7 @@ interface FormConfigInterface /** * Returns all options passed during the construction of the form. * - * @return array The passed options + * @return array The passed options */ public function getOptions(); diff --git a/src/Symfony/Component/Form/FormTypeInterface.php b/src/Symfony/Component/Form/FormTypeInterface.php index 6850d54968..9727a2e569 100644 --- a/src/Symfony/Component/Form/FormTypeInterface.php +++ b/src/Symfony/Component/Form/FormTypeInterface.php @@ -24,6 +24,8 @@ interface FormTypeInterface * This method is called for each type in the hierarchy starting from the * top most type. Type extensions can further modify the form. * + * @param array $options + * * @see FormTypeExtensionInterface::buildForm() */ public function buildForm(FormBuilderInterface $builder, array $options); @@ -38,6 +40,8 @@ interface FormTypeInterface * This means that you cannot access child views in this method. If you need * to do so, move your logic to {@link finishView()} instead. * + * @param array $options + * * @see FormTypeExtensionInterface::buildView() */ public function buildView(FormView $view, FormInterface $form, array $options); @@ -53,6 +57,8 @@ interface FormTypeInterface * such logic in this method that actually accesses child views. For everything * else you are recommended to implement {@link buildView()} instead. * + * @param array $options + * * @see FormTypeExtensionInterface::finishView() */ public function finishView(FormView $view, FormInterface $form, array $options);