[Form] fixed Form::setParent(null)
This commit is contained in:
parent
214f0de6e9
commit
30c145775d
@ -259,7 +259,7 @@ class Form implements \IteratorAggregate, FormInterface
|
|||||||
throw new AlreadyBoundException('You cannot set the parent of a bound form');
|
throw new AlreadyBoundException('You cannot set the parent of a bound form');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('' === $this->config->getName()) {
|
if (null !== $parent && '' === $this->config->getName()) {
|
||||||
throw new FormException('A form with an empty name cannot have a parent form.');
|
throw new FormException('A form with an empty name cannot have a parent form.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable
|
|||||||
/**
|
/**
|
||||||
* Sets the parent form.
|
* Sets the parent form.
|
||||||
*
|
*
|
||||||
* @param FormInterface $parent The parent form
|
* @param FormInterface|null $parent The parent form or null if it's the root.
|
||||||
*
|
*
|
||||||
* @return FormInterface The form instance
|
* @return FormInterface The form instance
|
||||||
*/
|
*/
|
||||||
@ -30,7 +30,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable
|
|||||||
/**
|
/**
|
||||||
* Returns the parent form.
|
* Returns the parent form.
|
||||||
*
|
*
|
||||||
* @return FormInterface The parent form
|
* @return FormInterface|null The parent form or null if there is none.
|
||||||
*/
|
*/
|
||||||
public function getParent();
|
public function getParent();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user