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

Skip to content

Commit 9db655a

Browse files
wkaniajaviereguiluz
authored andcommitted
[Validator] Use constant instead of magic string
1 parent 23a8b39 commit 9db655a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

reference/constraints/CardScheme.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ on an object that will contain a credit card number.
101101
{
102102
$metadata->addPropertyConstraint('cardNumber', new Assert\CardScheme([
103103
'schemes' => [
104-
'VISA',
104+
Assert\CardScheme::VISA,
105105
],
106106
'message' => 'Your credit card number is invalid.',
107107
]));

reference/constraints/Isbn.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ on an object that will contain an ISBN.
100100
public static function loadValidatorMetadata(ClassMetadata $metadata)
101101
{
102102
$metadata->addPropertyConstraint('isbn', new Assert\Isbn([
103-
'type' => 'isbn10',
103+
'type' => Assert\Isbn::ISBN_10,
104104
'message' => 'This value is not valid.',
105105
]));
106106
}

0 commit comments

Comments
 (0)