Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
Closed
Labels
Description
This is what is writing in the documentation:
isbn10¶
type: boolean
If this required option is set to true the constraint will check if the code is a valid ISBN-10 code.
isbn13¶
type: boolean
If this required option is set to true the constraint will check if the code is a valid ISBN-13 code.
Here is the code:
if (10 === $valueLength && null !== $constraint->isbn10) {
...
} elseif (13 === $valueLength && null !== $constraint->isbn13) {
...
} else {
...
}
The problem is when I set to false the isbn10 and to true the isbn13 parameters, I get the bothIsbnMessage instead of the isbn13Message.
I suggest to change the code like this:
if (10 === $valueLength && $constraint->isbn10) {
...
} elseif (13 === $valueLength && $constraint->isbn13) {
...
} else {
...
}