[Form] Fixed documentation, and the DateType (default options)

This commit is contained in:
William DURAND 2012-04-11 17:26:46 +02:00
parent 05842c54b8
commit 779d3bbb8e
4 changed files with 1 additions and 13 deletions

View File

@ -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()

View File

@ -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()

View File

@ -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'];

View File

@ -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();