Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
stampycode committed Sep 1, 2015
commit 43258c8b079dd4195494ab76c61ec63b3be36b58
8 changes: 4 additions & 4 deletions book/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down Expand Up @@ -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',
)));
}
Expand Down Expand Up @@ -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()
{
Expand Down Expand Up @@ -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'),
)));
Expand Down