Skip to content
Snippets Groups Projects
Unverified Commit 0ffa3f0f authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3233466 by daffie: [Symfony 6] Add "ConstraintValidatorInterface" type...

Issue #3233466 by daffie: [Symfony 6] Add "ConstraintValidatorInterface" type hint to methods overiding Symfony\Component\Validator\ConstraintValidatorFactoryInterface::getInstance()
parent e147702d
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@
use Drupal\Core\DependencyInjection\ClassResolverInterface;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidatorFactory as BaseConstraintValidatorFactory;
use Symfony\Component\Validator\ConstraintValidatorInterface;
/**
* Defines a constraint validator factory that works with container injection.
......@@ -26,7 +27,7 @@ public function __construct(ClassResolverInterface $class_resolver) {
/**
* {@inheritdoc}
*/
public function getInstance(Constraint $constraint) {
public function getInstance(Constraint $constraint): ConstraintValidatorInterface {
$class_name = $constraint->validatedBy();
// Constraint validator instances should always be initialized newly and
// never shared, because the current validation context is getting injected
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment