Symfony\Component\Validator\ValidationVisitor::__construct
Creates a new validation visitor.
Signature
public function __construct(mixed
$root,
[MetadataFactoryInterface
$metadataFactory = null,
[ConstraintValidatorFactoryInterface
$validatorFactory = null,
[TranslatorInterface
$translator = null,
[string|null
$translationDomain = null,
array
$objectInitializers]]]] )
Parameters
$root
— mixed- The value passed to the validator.
$metadataFactory
— Symfony\Component\Validator\MetadataFactoryInterface- The factory for obtaining metadata instances.
$validatorFactory
— Symfony\Component\Validator\ConstraintValidatorFactoryInterface- The factory for creating constraint validators.
$translator
— Symfony\Component\Translation\TranslatorInterface- The translator for translating violation messages.
$translationDomain
— object- The domain of the translation messages.
$objectInitializers
— array- The initializers for preparing objects before validation.
Errors/Exceptions
-
UnexpectedTypeException
- If any of the object initializers is not an instance of ObjectInitializerInterface