Skip to content

Commit 9a5ea56

Browse files
Tim Stampweaverryan
Tim Stamp
authored andcommitted
Updating book examples to not use deprecated validation methods
1 parent 627d74d commit 9a5ea56

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

book/validation.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ this method must return ``true``:
625625
class Author
626626
{
627627
/**
628-
* @Assert\True(message = "The password cannot match your first name")
628+
* @Assert\IsTrue(message = "The password cannot match your first name")
629629
*/
630630
public function isPasswordLegal()
631631
{
@@ -670,7 +670,7 @@ this method must return ``true``:
670670
{
671671
public static function loadValidatorMetadata(ClassMetadata $metadata)
672672
{
673-
$metadata->addGetterConstraint('passwordLegal', new Assert\True(array(
673+
$metadata->addGetterConstraint('passwordLegal', new Assert\IsTrue(array(
674674
'message' => 'The password cannot match your first name',
675675
)));
676676
}
@@ -928,7 +928,7 @@ username and the password are different only if all other validation passes
928928
private $password;
929929
930930
/**
931-
* @Assert\True(message="The password cannot match your username", groups={"Strict"})
931+
* @Assert\IsTrue(message="The password cannot match your username", groups={"Strict"})
932932
*/
933933
public function isPasswordLegal()
934934
{
@@ -1002,7 +1002,7 @@ username and the password are different only if all other validation passes
10021002
$metadata->addPropertyConstraint('username', new Assert\NotBlank());
10031003
$metadata->addPropertyConstraint('password', new Assert\NotBlank());
10041004
1005-
$metadata->addGetterConstraint('passwordLegal', new Assert\True(array(
1005+
$metadata->addGetterConstraint('passwordLegal', new Assert\IsTrue(array(
10061006
'message' => 'The password cannot match your first name',
10071007
'groups' => array('Strict'),
10081008
)));

0 commit comments

Comments
 (0)