-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #39070 [Validator] Remove IsinValidator's validator dependency (d…
…errabus) This PR was merged into the 5.2 branch. Discussion ---------- [Validator] Remove IsinValidator's validator dependency | Q | A | ------------- | --- | Branch? | 5.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #39069 | License | MIT | Doc PR | N/A Commits ------- 4cb7dec347 [Validator] Resolve IsinValidator's dependency on the validator.
- Loading branch information
Showing
2 changed files
with
5 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,6 @@ | |
use Symfony\Component\Validator\ConstraintValidator; | ||
use Symfony\Component\Validator\Exception\UnexpectedTypeException; | ||
use Symfony\Component\Validator\Exception\UnexpectedValueException; | ||
use Symfony\Component\Validator\Validator\ValidatorInterface; | ||
|
||
/** | ||
* @author Laurent Masforné <[email protected]> | ||
|
@@ -24,16 +23,6 @@ | |
*/ | ||
class IsinValidator extends ConstraintValidator | ||
{ | ||
/** | ||
* @var ValidatorInterface | ||
*/ | ||
private $validator; | ||
|
||
public function __construct(ValidatorInterface $validator) | ||
{ | ||
$this->validator = $validator; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
|
@@ -87,6 +76,6 @@ private function isCorrectChecksum(string $input): bool | |
} | ||
$number = implode('', $characters); | ||
|
||
return 0 === $this->validator->validate($number, new Luhn())->count(); | ||
return 0 === $this->context->getValidator()->validate($number, new Luhn())->count(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters