[Form] Fixed issues mentioned in the PR comments

This commit is contained in:
Bernhard Schussek 2012-02-09 17:13:33 +01:00
parent 3b1b57030b
commit 22c8f8087c
5 changed files with 6 additions and 6 deletions

View File

@ -237,14 +237,14 @@ UPGRADE FROM 2.0 to 2.1
Before: Before:
public function getParent() public function getParent(array $options)
{ {
return 'single_text' === $options['widget'] ? 'text' : 'choice'; return 'single_text' === $options['widget'] ? 'text' : 'choice';
} }
After: After:
public function getParent() public function getParent(array $options)
{ {
return isset($options['widget']) && 'single_text' === $options['widget'] ? 'text' : 'choice'; return isset($options['widget']) && 'single_text' === $options['widget'] ? 'text' : 'choice';
} }

View File

@ -107,7 +107,7 @@ class ChoicesToBooleanArrayTransformer implements DataTransformerInterface
} }
if (count($unknown) > 0) { if (count($unknown) > 0) {
throw new TransformationFailedException('The choices "' . implode('", "', $unknown) . '" where not found'); throw new TransformationFailedException('The choices "' . implode('", "', $unknown) . '" were not found');
} }
return $result; return $result;

View File

@ -264,6 +264,6 @@ class DateTimeTypeTest extends LocalizedTestCase
{ {
// Throws an exception if "data_class" option is not explicitely set // Throws an exception if "data_class" option is not explicitely set
// to null in the type // to null in the type
$form = $this->factory->create('datetime', new \DateTime()); $this->factory->create('datetime', new \DateTime());
} }
} }

View File

@ -536,6 +536,6 @@ class DateTypeTest extends LocalizedTestCase
{ {
// Throws an exception if "data_class" option is not explicitely set // Throws an exception if "data_class" option is not explicitely set
// to null in the type // to null in the type
$form = $this->factory->create('date', new \DateTime()); $this->factory->create('date', new \DateTime());
} }
} }

View File

@ -407,6 +407,6 @@ class TimeTypeTest extends LocalizedTestCase
{ {
// Throws an exception if "data_class" option is not explicitely set // Throws an exception if "data_class" option is not explicitely set
// to null in the type // to null in the type
$form = $this->factory->create('time', new \DateTime()); $this->factory->create('time', new \DateTime());
} }
} }