Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Form] update type of form $name arguments #32828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions 5 src/Symfony/Component/Form/ButtonBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/Form/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/Form/FormBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 4 additions & 6 deletions 10 src/Symfony/Component/Form/FormBuilderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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
*/
Expand Down
10 changes: 4 additions & 6 deletions 10 src/Symfony/Component/Form/FormConfigBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -787,15 +785,15 @@ 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
*/
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)) {
Expand Down
14 changes: 6 additions & 8 deletions 14 src/Symfony/Component/Form/FormFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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
*
Expand Down
6 changes: 3 additions & 3 deletions 6 src/Symfony/Component/Form/FormInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.