From 779d3bbb8e8f5b30ef5e6feb529e3354b4961fee Mon Sep 17 00:00:00 2001 From: William DURAND Date: Wed, 11 Apr 2012 17:26:46 +0200 Subject: [PATCH] [Form] Fixed documentation, and the DateType (default options) --- src/Symfony/Component/Form/AbstractType.php | 4 ---- src/Symfony/Component/Form/AbstractTypeExtension.php | 4 ---- src/Symfony/Component/Form/Extension/Core/Type/DateType.php | 2 +- src/Symfony/Component/Form/FormTypeInterface.php | 4 ---- 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/Symfony/Component/Form/AbstractType.php b/src/Symfony/Component/Form/AbstractType.php index 7541aa4c0c..0f21b81663 100644 --- a/src/Symfony/Component/Form/AbstractType.php +++ b/src/Symfony/Component/Form/AbstractType.php @@ -92,8 +92,6 @@ abstract class AbstractType implements FormTypeInterface /** * Returns the default options for this type. * - * @param array $options - * * @return array The default options */ public function getDefaultOptions() @@ -104,8 +102,6 @@ abstract class AbstractType implements FormTypeInterface /** * Returns the allowed option values for each option (if any). * - * @param array $options - * * @return array The allowed option values */ public function getAllowedOptionValues() diff --git a/src/Symfony/Component/Form/AbstractTypeExtension.php b/src/Symfony/Component/Form/AbstractTypeExtension.php index 7d9247b535..51eb3075b1 100644 --- a/src/Symfony/Component/Form/AbstractTypeExtension.php +++ b/src/Symfony/Component/Form/AbstractTypeExtension.php @@ -61,8 +61,6 @@ abstract class AbstractTypeExtension implements FormTypeExtensionInterface /** * Overrides the default options form the extended type. * - * @param array $options - * * @return array */ public function getDefaultOptions() @@ -73,8 +71,6 @@ abstract class AbstractTypeExtension implements FormTypeExtensionInterface /** * Returns the allowed option values for each option (if any). * - * @param array $options - * * @return array The allowed option values */ public function getAllowedOptionValues() diff --git a/src/Symfony/Component/Form/Extension/Core/Type/DateType.php b/src/Symfony/Component/Form/Extension/Core/Type/DateType.php index eb5e85d1a4..51d09ce641 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/DateType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/DateType.php @@ -44,7 +44,7 @@ class DateType extends AbstractType // If $format is not in the allowed options, it's considered as the pattern of the formatter if it is a string if (!in_array($format, $allowedFormatOptionValues, true)) { if (is_string($format)) { - $defaultOptions = $this->getDefaultOptions($options); + $defaultOptions = array_merge($this->getDefaultOptions(), $options); $format = $defaultOptions['format']; $pattern = $options['format']; diff --git a/src/Symfony/Component/Form/FormTypeInterface.php b/src/Symfony/Component/Form/FormTypeInterface.php index b4236882bc..556792c247 100644 --- a/src/Symfony/Component/Form/FormTypeInterface.php +++ b/src/Symfony/Component/Form/FormTypeInterface.php @@ -75,8 +75,6 @@ interface FormTypeInterface /** * Returns the default options for this type. * - * @param array $options - * * @return array The default options */ function getDefaultOptions(); @@ -84,8 +82,6 @@ interface FormTypeInterface /** * Returns the allowed option values for each option (if any). * - * @param array $options - * * @return array The allowed option values */ function getAllowedOptionValues();