From 6d4dcadd660f6318abed7389423bc2fdbde38a0d Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 31 Jul 2019 13:39:02 +0200 Subject: [PATCH] [Form] update type of form $name arguments --- src/Symfony/Component/Form/ButtonBuilder.php | 5 ++--- src/Symfony/Component/Form/Form.php | 2 +- src/Symfony/Component/Form/FormBuilder.php | 2 +- .../Component/Form/FormBuilderInterface.php | 10 ++++------ src/Symfony/Component/Form/FormConfigBuilder.php | 10 ++++------ .../Component/Form/FormFactoryInterface.php | 14 ++++++-------- src/Symfony/Component/Form/FormInterface.php | 6 +++--- 7 files changed, 21 insertions(+), 28 deletions(-) diff --git a/src/Symfony/Component/Form/ButtonBuilder.php b/src/Symfony/Component/Form/ButtonBuilder.php index 598749eeac27d..9aa0935ed5ec9 100644 --- a/src/Symfony/Component/Form/ButtonBuilder.php +++ b/src/Symfony/Component/Form/ButtonBuilder.php @@ -71,9 +71,8 @@ public function __construct($name, array $options = []) * * This method should not be invoked. * - * @param string|int|FormBuilderInterface $child - * @param string|FormTypeInterface $type - * @param array $options + * @param string|FormBuilderInterface $child + * @param string|FormTypeInterface $type * * @throws BadMethodCallException */ diff --git a/src/Symfony/Component/Form/Form.php b/src/Symfony/Component/Form/Form.php index 63ef109e67624..dc82afb10309c 100644 --- a/src/Symfony/Component/Form/Form.php +++ b/src/Symfony/Component/Form/Form.php @@ -819,7 +819,7 @@ public function add($child, $type = null, array $options = []) if (!$child instanceof FormInterface) { if (!\is_string($child) && !\is_int($child)) { - throw new UnexpectedTypeException($child, 'string, integer or Symfony\Component\Form\FormInterface'); + throw new UnexpectedTypeException($child, 'string or Symfony\Component\Form\FormInterface'); } if (null !== $type && !\is_string($type) && !$type instanceof FormTypeInterface) { diff --git a/src/Symfony/Component/Form/FormBuilder.php b/src/Symfony/Component/Form/FormBuilder.php index 13b1ea3b36420..f4388edd69ab5 100644 --- a/src/Symfony/Component/Form/FormBuilder.php +++ b/src/Symfony/Component/Form/FormBuilder.php @@ -70,7 +70,7 @@ public function add($child, $type = null, array $options = []) } if (!\is_string($child) && !\is_int($child)) { - throw new UnexpectedTypeException($child, 'string, integer or Symfony\Component\Form\FormBuilderInterface'); + throw new UnexpectedTypeException($child, 'string or Symfony\Component\Form\FormBuilderInterface'); } if (null !== $type && !\is_string($type) && !$type instanceof FormTypeInterface) { diff --git a/src/Symfony/Component/Form/FormBuilderInterface.php b/src/Symfony/Component/Form/FormBuilderInterface.php index 1ed695ed044d8..902fa0f9505e5 100644 --- a/src/Symfony/Component/Form/FormBuilderInterface.php +++ b/src/Symfony/Component/Form/FormBuilderInterface.php @@ -23,9 +23,8 @@ interface FormBuilderInterface extends \Traversable, \Countable, FormConfigBuild * If you add a nested group, this group should also be represented in the * object hierarchy. * - * @param string|int|FormBuilderInterface $child - * @param string|null $type - * @param array $options + * @param string|FormBuilderInterface $child + * @param string|null $type * * @return self */ @@ -34,9 +33,8 @@ public function add($child, $type = null, array $options = []); /** * 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 array $options The options + * @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 * * @return self */ diff --git a/src/Symfony/Component/Form/FormConfigBuilder.php b/src/Symfony/Component/Form/FormConfigBuilder.php index fea1d70cd8ee4..eb5d2f65a245d 100644 --- a/src/Symfony/Component/Form/FormConfigBuilder.php +++ b/src/Symfony/Component/Form/FormConfigBuilder.php @@ -121,10 +121,8 @@ class FormConfigBuilder implements FormConfigBuilderInterface /** * Creates an empty form configuration. * - * @param string|int $name The form name - * @param string|null $dataClass The class of the form's data - * @param EventDispatcherInterface $dispatcher The event dispatcher - * @param array $options The form options + * @param string $name The form name + * @param string|null $dataClass The class of the form's data * * @throws InvalidArgumentException if the data class is not a valid class or if * the name contains invalid characters @@ -787,7 +785,7 @@ public function getFormConfig() /** * Validates whether the given variable is a valid form name. * - * @param string|int|null $name The tested form name + * @param string|null $name The tested form name * * @throws UnexpectedTypeException if the name is not a string or an integer * @throws InvalidArgumentException if the name contains invalid characters @@ -795,7 +793,7 @@ public function getFormConfig() public static function validateName($name) { if (null !== $name && !\is_string($name) && !\is_int($name)) { - throw new UnexpectedTypeException($name, 'string, integer or null'); + throw new UnexpectedTypeException($name, 'string or null'); } if (!self::isValidName($name)) { diff --git a/src/Symfony/Component/Form/FormFactoryInterface.php b/src/Symfony/Component/Form/FormFactoryInterface.php index 597537ad88c1c..6214240c592c4 100644 --- a/src/Symfony/Component/Form/FormFactoryInterface.php +++ b/src/Symfony/Component/Form/FormFactoryInterface.php @@ -36,10 +36,9 @@ public function create($type = 'Symfony\Component\Form\Extension\Core\Type\FormT * * @see createNamedBuilder() * - * @param string|int $name The name of the form - * @param string $type The type of the form - * @param mixed $data The initial data - * @param array $options The options + * @param string $name The name of the form + * @param string $type The type of the form + * @param mixed $data The initial data * * @return FormInterface The form * @@ -79,10 +78,9 @@ public function createBuilder($type = 'Symfony\Component\Form\Extension\Core\Typ /** * Returns a form builder. * - * @param string|int $name The name of the form - * @param string $type The type of the form - * @param mixed $data The initial data - * @param array $options The options + * @param string $name The name of the form + * @param string $type The type of the form + * @param mixed $data The initial data * * @return FormBuilderInterface The form builder * diff --git a/src/Symfony/Component/Form/FormInterface.php b/src/Symfony/Component/Form/FormInterface.php index 5455e1afc44f2..25dff2aa9794f 100644 --- a/src/Symfony/Component/Form/FormInterface.php +++ b/src/Symfony/Component/Form/FormInterface.php @@ -43,9 +43,9 @@ public function getParent(); /** * Adds or replaces a child to the form. * - * @param FormInterface|string|int $child The FormInterface instance or the name of the child - * @param string|null $type The child's type, if a name was passed - * @param array $options The child's options, if a name was passed + * @param FormInterface|string $child The FormInterface instance or the name of the child + * @param string|null $type The child's type, if a name was passed + * @param array $options The child's options, if a name was passed * * @return $this * 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