[Form] Fixed typos
This commit is contained in:
parent
ac6939441f
commit
af41a1a550
|
@ -551,7 +551,7 @@
|
||||||
));
|
));
|
||||||
```
|
```
|
||||||
|
|
||||||
After (if the address object is an array):
|
After:
|
||||||
|
|
||||||
```
|
```
|
||||||
$builder->add('name', 'text', array(
|
$builder->add('name', 'text', array(
|
||||||
|
|
|
@ -79,10 +79,14 @@ class FormValidator extends ConstraintValidator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
$clientDataAsString = is_scalar($form->getClientData())
|
||||||
|
? (string) $form->getClientData()
|
||||||
|
: gettype($form->getClientData());
|
||||||
|
|
||||||
// Mark the form with an error if it is not synchronized
|
// Mark the form with an error if it is not synchronized
|
||||||
$this->context->addViolation(
|
$this->context->addViolation(
|
||||||
$form->getAttribute('invalid_message'),
|
$form->getAttribute('invalid_message'),
|
||||||
array('{{ value }}' => (string) $form->getClientData()),
|
array('{{ value }}' => $clientDataAsString),
|
||||||
$form->getClientData(),
|
$form->getClientData(),
|
||||||
null,
|
null,
|
||||||
Form::ERR_INVALID
|
Form::ERR_INVALID
|
||||||
|
|
|
@ -64,7 +64,7 @@ class ValidationListener implements EventSubscriberInterface
|
||||||
if (count($violations) > 0) {
|
if (count($violations) > 0) {
|
||||||
foreach ($violations as $violation) {
|
foreach ($violations as $violation) {
|
||||||
// Allow the "invalid" constraint to be put onto
|
// Allow the "invalid" constraint to be put onto
|
||||||
// non-synchzronized forms
|
// non-synchronized forms
|
||||||
$allowNonSynchronized = Form::ERR_INVALID === $violation->getCode();
|
$allowNonSynchronized = Form::ERR_INVALID === $violation->getCode();
|
||||||
|
|
||||||
$this->violationMapper->mapViolation($violation, $form, $allowNonSynchronized);
|
$this->violationMapper->mapViolation($violation, $form, $allowNonSynchronized);
|
||||||
|
|
|
@ -348,7 +348,7 @@ class Form implements \IteratorAggregate, FormInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new FormException(
|
throw new FormException(
|
||||||
'The form\'s client data is expected to of type ' . $expectedType . ', ' .
|
'The form\'s client data is expected to be of type ' . $expectedType . ', ' .
|
||||||
'but is an instance of class ' . get_class($clientData) . '. You ' .
|
'but is an instance of class ' . get_class($clientData) . '. You ' .
|
||||||
'can avoid this error by setting the "data_class" option to ' .
|
'can avoid this error by setting the "data_class" option to ' .
|
||||||
'"' . get_class($clientData) . '" or by adding a client transformer ' .
|
'"' . get_class($clientData) . '" or by adding a client transformer ' .
|
||||||
|
|
Reference in New Issue