[Form] Fixed issues mentioned in the PR comments
This commit is contained in:
parent
3b1b57030b
commit
22c8f8087c
@ -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';
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
@ -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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user