Skip to content

Commit af41a1a

Browse files
committed
[Form] Fixed typos
1 parent ac69394 commit af41a1a

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

UPGRADE-2.1.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@
551551
));
552552
```
553553
554-
After (if the address object is an array):
554+
After:
555555
556556
```
557557
$builder->add('name', 'text', array(

src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,14 @@ public function validate($form, Constraint $constraint)
7979
}
8080
}
8181
} else {
82+
$clientDataAsString = is_scalar($form->getClientData())
83+
? (string) $form->getClientData()
84+
: gettype($form->getClientData());
85+
8286
// Mark the form with an error if it is not synchronized
8387
$this->context->addViolation(
8488
$form->getAttribute('invalid_message'),
85-
array('{{ value }}' => (string) $form->getClientData()),
89+
array('{{ value }}' => $clientDataAsString),
8690
$form->getClientData(),
8791
null,
8892
Form::ERR_INVALID

src/Symfony/Component/Form/Extension/Validator/EventListener/ValidationListener.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function validateForm(DataEvent $event)
6464
if (count($violations) > 0) {
6565
foreach ($violations as $violation) {
6666
// Allow the "invalid" constraint to be put onto
67-
// non-synchzronized forms
67+
// non-synchronized forms
6868
$allowNonSynchronized = Form::ERR_INVALID === $violation->getCode();
6969

7070
$this->violationMapper->mapViolation($violation, $form, $allowNonSynchronized);

src/Symfony/Component/Form/Form.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ public function setData($appData)
348348
}
349349

350350
throw new FormException(
351-
'The form\'s client data is expected to of type ' . $expectedType . ', ' .
351+
'The form\'s client data is expected to be of type ' . $expectedType . ', ' .
352352
'but is an instance of class ' . get_class($clientData) . '. You ' .
353353
'can avoid this error by setting the "data_class" option to ' .
354354
'"' . get_class($clientData) . '" or by adding a client transformer ' .

0 commit comments

Comments
 (0)