Permalink
Browse files

[Form] fix PhpDoc

  • Loading branch information...
1 parent 4706b23 commit fae4396a8a572e420a3b0ed1125a46bdb9507064 @Tobion Tobion committed May 21, 2012
View
@@ -44,13 +44,7 @@
private $typeGuesserLoaded = false;
/**
- * Returns a type by name.
- *
- * @param string $name The name of the type
- *
- * @return FormTypeInterface The type
- *
- * @throws FormException if the given type is not supported by this extension
+ * {@inheritdoc}
*/
public function getType($name)
{
@@ -66,11 +60,7 @@ public function getType($name)
}
/**
- * Returns whether the given type is supported.
- *
- * @param string $name The name of the type
- *
- * @return Boolean Whether the type is supported by this extension
+ * {@inheritdoc}
*/
public function hasType($name)
{
@@ -82,11 +72,7 @@ public function hasType($name)
}
/**
- * Returns the extensions for the given type.
- *
- * @param string $name The name of the type
- *
- * @return array An array of extensions as FormTypeExtensionInterface instances
+ * {@inheritdoc}
*/
public function getTypeExtensions($name)
{
@@ -100,11 +86,7 @@ public function getTypeExtensions($name)
}
/**
- * Returns whether this extension provides type extensions for the given type.
- *
- * @param string $name The name of the type
- *
- * @return Boolean Whether the given type has extensions
+ * {@inheritdoc}
*/
public function hasTypeExtensions($name)
{
@@ -116,9 +98,7 @@ public function hasTypeExtensions($name)
}
/**
- * Returns the type guesser provided by this extension.
- *
- * @return FormTypeGuesserInterface|null The type guesser
+ * {@inheritdoc}
*/
public function getTypeGuesser()
{
View
@@ -22,111 +22,60 @@
private $extensions = array();
/**
- * Builds the form.
- *
- * This method gets called for each type in the hierarchy starting from the
- * top most type.
- * Type extensions can further modify the form.
- *
- * @see FormTypeExtensionInterface::buildForm()
- *
- * @param FormBuilder $builder The form builder
- * @param array $options The options
+ * {@inheritdoc}
*/
public function buildForm(FormBuilder $builder, array $options)
{
}
/**
- * Builds the form view.
- *
- * This method gets called for each type in the hierarchy starting from the
- * top most type.
- * Type extensions can further modify the view.
- *
- * @see FormTypeExtensionInterface::buildView()
- *
- * @param FormView $view The view
- * @param FormInterface $form The form
+ * {@inheritdoc}
*/
public function buildView(FormView $view, FormInterface $form)
{
}
/**
- * Builds the form view.
- *
- * This method gets called for each type in the hierarchy starting from the
- * top most type.
- * Type extensions can further modify the view.
- *
- * Children views have been built while this method gets called so you get
- * a chance to modify them.
- *
- * @see FormTypeExtensionInterface::buildViewBottomUp()
- *
- * @param FormView $view The view
- * @param FormInterface $form The form
+ * {@inheritdoc}
*/
public function buildViewBottomUp(FormView $view, FormInterface $form)
{
}
/**
- * Returns a builder for the current type.
- *
- * The builder is retrieved by going up in the type hierarchy when a type does
- * not provide one.
- *
- * @param string $name The name of the builder
- * @param FormFactoryInterface $factory The form factory
- * @param array $options The options
- *
- * @return FormBuilder|null A form builder or null when the type does not have a builder
+ * {@inheritdoc}
*/
public function createBuilder($name, FormFactoryInterface $factory, array $options)
{
return null;
}
/**
- * Returns the default options for this type.
- *
- * @return array The default options
+ * {@inheritdoc}
*/
public function getDefaultOptions()
{
return array();
}
/**
- * Returns the allowed option values for each option (if any).
- *
- * @return array The allowed option values
+ * {@inheritdoc}
*/
public function getAllowedOptionValues()
{
return array();
}
/**
- * Returns the name of the parent type.
- *
- * @param array $options
- *
- * @return string|null The name of the parent type if any otherwise null
+ * {@inheritdoc}
*/
public function getParent(array $options)
{
return 'form';
}
/**
- * Adds extensions for this type.
- *
- * @param array $extensions An array of FormTypeExtensionInterface
- *
- * @throws UnexpectedTypeException if any extension does not implement FormTypeExtensionInterface
+ * {@inheritdoc}
*/
public function setExtensions(array $extensions)
{
@@ -140,9 +89,7 @@ public function setExtensions(array $extensions)
}
/**
- * Returns the extensions associated with this type.
- *
- * @return array An array of FormTypeExtensionInterface
+ * {@inheritdoc}
*/
public function getExtensions()
{
View
@@ -14,64 +14,36 @@
abstract class AbstractTypeExtension implements FormTypeExtensionInterface
{
/**
- * Builds the form.
- *
- * This method gets called after the extended type has built the form to
- * further modify it.
- *
- * @see FormTypeInterface::buildForm()
- *
- * @param FormBuilder $builder The form builder
- * @param array $options The options
+ * {@inheritdoc}
*/
public function buildForm(FormBuilder $builder, array $options)
{
}
/**
- * Builds the view.
- *
- * This method gets called after the extended type has built the view to
- * further modify it.
- *
- * @see FormTypeInterface::buildView()
- *
- * @param FormView $view The view
- * @param FormInterface $form The form
+ * {@inheritdoc}
*/
public function buildView(FormView $view, FormInterface $form)
{
}
/**
- * Builds the view.
- *
- * This method gets called after the extended type has built the view to
- * further modify it.
- *
- * @see FormTypeInterface::buildViewBottomUp()
- *
- * @param FormView $view The view
- * @param FormInterface $form The form
+ * {@inheritdoc}
*/
public function buildViewBottomUp(FormView $view, FormInterface $form)
{
}
/**
- * Overrides the default options form the extended type.
- *
- * @return array
+ * {@inheritdoc}
*/
public function getDefaultOptions()
{
return array();
}
/**
- * Returns the allowed option values for each option (if any).
- *
- * @return array The allowed option values
+ * {@inheritdoc}
*/
public function getAllowedOptionValues()
{
View
@@ -13,6 +13,12 @@
interface DataMapperInterface
{
+ /**
+ * @param dataClass $data
+ * @param array $forms
+ *
+ * @throws Exception\UnexpectedTypeException if the type of the data parameter is not supported
+ */
function mapDataToForms($data, array $forms);
function mapDataToForm($data, FormInterface $form);
@@ -31,10 +31,7 @@ public function __construct($dataClass = null)
}
/**
- * @param dataClass $data
- * @param array $forms
- *
- * @throws UnexpectedTypeException if the type of the data parameter is not supported
+ * {@inheritdoc}
*/
public function mapDataToForms($data, array $forms)
{
@@ -56,6 +53,9 @@ public function mapDataToForms($data, array $forms)
}
}
+ /**
+ * {@inheritdoc}
+ */
public function mapDataToForm($data, FormInterface $form)
{
if (!empty($data)) {
@@ -73,6 +73,9 @@ public function mapDataToForm($data, FormInterface $form)
}
}
+ /**
+ * {@inheritdoc}
+ */
public function mapFormsToData(array $forms, &$data)
{
$iterator = new VirtualFormAwareIterator($forms);
@@ -83,6 +86,9 @@ public function mapFormsToData(array $forms, &$data)
}
}
+ /**
+ * {@inheritdoc}
+ */
public function mapFormToData(FormInterface $form, &$data)
{
$propertyPath = $form->getAttribute('property_path');
@@ -16,7 +16,7 @@
use Symfony\Component\Form\AbstractExtension;
/**
- * This extension protects forms by using a CSRF token
+ * This extension protects forms by using a CSRF token.
*/
class CsrfExtension extends AbstractExtension
{
@@ -12,7 +12,7 @@
namespace Symfony\Component\Form\Extension\Csrf\CsrfProvider;
/**
- * Default implementation of CsrfProviderInterface
+ * Default implementation of CsrfProviderInterface.
*
* This provider uses the session ID returned by session_id() as well as a
* user-defined secret value to secure the CSRF token.
@@ -57,11 +57,11 @@ public function isCsrfTokenValid($intention, $token)
}
/**
- * Returns the ID of the user session
+ * Returns the ID of the user session.
*
* Automatically starts the session if necessary.
*
- * @return string The session ID
+ * @return string The session ID
*/
protected function getSessionId()
{
@@ -15,11 +15,11 @@
/**
* This provider uses a Symfony2 Session object to retrieve the user's
- * session ID
+ * session ID.
*
- * @author Bernhard Schussek <bernhard.schussek@symfony.com>
+ * @see DefaultCsrfProvider
*
- * @see DefaultCsrfProvider
+ * @author Bernhard Schussek <bernhard.schussek@symfony.com>
*/
class SessionCsrfProvider extends DefaultCsrfProvider
{
@@ -30,7 +30,7 @@ class SessionCsrfProvider extends DefaultCsrfProvider
protected $session;
/**
- * Initializes the provider with a Session object and a secret value
+ * Initializes the provider with a Session object and a secret value.
*
* A recommended value for the secret is a generated value with at least
* 32 characters and mixed letters, digits and special characters.
@@ -46,11 +46,7 @@ public function __construct(Session $session, $secret)
}
/**
- * Returns the ID of the user session
- *
- * Automatically starts the session if necessary.
- *
- * @return string The session ID
+ * {@inheritdoc}
*/
protected function getSessionId()
{
@@ -22,6 +22,8 @@
* @param string $name The name of the type
*
* @return FormTypeInterface The type
+ *
+ * @throws Exception\FormException if the given type is not supported by this extension
*/
function getType($name);
Oops, something went wrong.

0 comments on commit fae4396

Please sign in to comment.