Skip to content

Commit 66051f7

Browse files
committed
minor #6399 Fixed wrong code examples for Isbn constraint (AAstakhov)
This PR was submitted for the 2.5 branch but it was merged into the 2.7 branch instead (closes #6399). Discussion ---------- Fixed wrong code examples for Isbn constraint | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.5+ | Fixed tickets | n/a 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 Commits ------- 503c07c Fixed wrong code examples for Isbn constraint
2 parents e7246b6 + 503c07c commit 66051f7

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
@@ -48,8 +48,8 @@ on an object that will contain an ISBN.
4848
{
4949
/**
5050
* @Assert\Isbn(
51-
* type = isbn10,
52-
* message: This value is not valid.
51+
* type = "isbn10",
52+
* message = "This value is not valid."
5353
* )
5454
*/
5555
protected $isbn;
@@ -99,7 +99,7 @@ on an object that will contain an ISBN.
9999
public static function loadValidatorMetadata(ClassMetadata $metadata)
100100
{
101101
$metadata->addPropertyConstraint('isbn', new Assert\Isbn(array(
102-
'type' => isbn10,
102+
'type' => 'isbn10',
103103
'message' => 'This value is not valid.'
104104
)));
105105
}

0 commit comments

Comments
 (0)