[Form] fixed Form::setParent(null)

This commit is contained in:
Tobias Schultze 2012-08-26 21:13:38 +02:00
parent 214f0de6e9
commit 30c145775d
2 changed files with 3 additions and 3 deletions

View File

@ -259,7 +259,7 @@ class Form implements \IteratorAggregate, FormInterface
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.');
}

View File

@ -21,7 +21,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable
/**
* 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
*/
@ -30,7 +30,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable
/**
* Returns the parent form.
*
* @return FormInterface The parent form
* @return FormInterface|null The parent form or null if there is none.
*/
public function getParent();