[Form] adding PHPDoc and some small PHPDoc changes.

This commit is contained in:
Ryan Weaver 2011-01-20 08:32:27 -06:00 committed by Fabien Potencier
parent 82283db789
commit d41b4ec109
3 changed files with 16 additions and 5 deletions

View File

@ -360,7 +360,7 @@ class Field extends Configurable implements FieldInterface
}
/**
* Returns weather there are errors.
* Returns whether or not there are errors.
*
* @return boolean true if form is bound and not valid
*/
@ -376,7 +376,7 @@ class Field extends Configurable implements FieldInterface
/**
* Returns all errors
*
* @return array An array of errors that occured during binding
* @return array An array of FieldError instances that occurred during binding
*/
public function getErrors()
{

View File

@ -92,6 +92,7 @@ class FieldGroup extends Field implements \IteratorAggregate, FieldGroupInterfac
* </code>
*
* @param FieldInterface|string $field
* @return FieldInterface
*/
public function add($field)
{
@ -113,7 +114,7 @@ class FieldGroup extends Field implements \IteratorAggregate, FieldGroupInterfac
$factory = $this->getRoot()->getFieldFactory();
if (!$factory) {
throw new \LogicException('A field factory must be available for automatically creating fields');
throw new \LogicException('A field factory must be available to automatically create fields');
}
$options = func_num_args() > 1 ? func_get_arg(1) : array();
@ -337,7 +338,7 @@ class FieldGroup extends Field implements \IteratorAggregate, FieldGroupInterfac
}
/**
* Updates the chield fields from the properties of the given data
* Updates the child fields from the properties of the given data
*
* This method calls updateFromProperty() on all child fields that have a
* property path set. If a child field has no property path set but

View File

@ -19,7 +19,8 @@ use Symfony\Component\Form\Exception\FormException;
* You can use the method setFieldMode() to switch between the modes
* HybridField::FIELD and HybridField::GROUP. This is useful when you want
* to create a field that, depending on its configuration, can either be
* a single field or a combination of different fields.
* a single field or a combination of different fields (e.g. a date field
* that might be a textbox or several select boxes).
*
* @author Bernhard Schussek <bernhard.schussek@symfony-project.com>
*/
@ -48,16 +49,25 @@ class HybridField extends FieldGroup
$this->mode = $mode;
}
/**
* @return boolean
*/
public function isField()
{
return self::FIELD === $this->mode;
}
/**
* @return boolean
*/
public function isGroup()
{
return self::GROUP === $this->mode;
}
/**
* @return integer
*/
public function getFieldMode()
{
return $this->mode;