8000 Fixed wrong code examples for Isbn constraint · a-ast/symfony-docs@27665d9 · GitHub
Skip to content

Commit 27665d9

Browse files
committed
Fixed wrong code examples for Isbn constraint
The example in the annotations code block causes an exception '[Semantical Error] Couldn't find constant isbn10'. It happens because attribute values in annotation blocks must be quoted. Additionally I fixed PHP code block to use quoted attribute also there
1 parent 747696a commit 27665d9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

reference/constraints/Isbn.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ on an object that will contain an ISBN.
5757
{
5858
/**
5959
* @Assert\Isbn(
60-
* type = isbn10,
61-
* message: This value is not valid.
60+
* type = "isbn10",
61+
* message: "This value is not valid."
6262
* )
6363
*/
6464
protected $isbn;
@@ -97,7 +97,7 @@ on an object that will contain an ISBN.
9797
public static function loadValidatorMetadata(ClassMetadata $metadata)
9898
{
9999
$metadata->addPropertyConstraint('isbn', new Assert\Isbn(array(
100-
'type' => isbn10,
100+
'type' => 'isbn10',
101101
'message' => 'This value is not valid.'
102102
)));
103103
}

0 commit comments

Comments
 (0)
0