From 43258c8b079dd4195494ab76c61ec63b3be36b58 Mon Sep 17 00:00:00 2001 From: StampyCode Date: Tue, 1 Sep 2015 10:41:03 +0100 Subject: [PATCH] Deprecated class replacement Assert\True class is deprecated since version 2.7 and will be removed in 3.0. Use the IsTrue class in the same namespace instead. --- book/validation.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/book/validation.rst b/book/validation.rst index f454b78e525..35c29958a4c 100644 --- a/book/validation.rst +++ b/book/validation.rst @@ -630,7 +630,7 @@ this method must return ``true``: class Author { /** - * @Assert\True(message = "The password cannot match your first name") + * @Assert\IsTrue(message = "The password cannot match your first name") */ public function isPasswordLegal() { @@ -675,7 +675,7 @@ this method must return ``true``: { public static function loadValidatorMetadata(ClassMetadata $metadata) { - $metadata->addGetterConstraint('passwordLegal', new Assert\True(array( + $metadata->addGetterConstraint('passwordLegal', new Assert\IsTrue(array( 'message' => 'The password cannot match your first name', ))); } @@ -937,7 +937,7 @@ username and the password are different only if all other validation passes private $password; /** - * @Assert\True(message="The password cannot match your username", groups={"Strict"}) + * @Assert\IsTrue(message="The password cannot match your username", groups={"Strict"}) */ public function isPasswordLegal() { @@ -1011,7 +1011,7 @@ username and the password are different only if all other validation passes $metadata->addPropertyConstraint('username', new Assert\NotBlank()); $metadata->addPropertyConstraint('password', new Assert\NotBlank()); - $metadata->addGetterConstraint('passwordLegal', new Assert\True(array( + $metadata->addGetterConstraint('passwordLegal', new Assert\IsTrue(array( 'message' => 'The password cannot match your first name', 'groups' => array('Strict'), )));