Issues with ValidatorConstraint in Symfony 2.5

after upgrading from Symfony 2.4 to 2.5, my form validation restrictions no longer work.

I get: Fatal error cropped: argument 1 passed to Symfony \ Component \ Form \ Extension \ Validator \ Type \ FormTypeValidatorExtension :: __ construct () should be an instance of Symfony \ Component \ Validator \ ValidatorInterface, an instance of Symfony \ Component \ Validator \ Validator \ RecursiveValidator defined by provider /symfony/symfony/src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php on line 36

Anyone have a suggestion on how to fix this?

+4
source share
1 answer

Try the api check in config.yml.

Comment by UPGRADE-2.5.md
https://github.com/symfony/symfony/blob/master/UPGRADE-2.5.md

"The validation mechanism in Symfony\Component\Validator\Validator been replaced with a new one in Symfony\Component\Validator\Validator\RecursiveValidator . With this change, several classes were deprecated that would be removed in Symfony 3.0. In addition, the validator API was slightly changed. More details can be found in UPGRADE-3.0.

You can select the desired API through the new "api" entry in the application /Config/config.yml: "

framework: validation: enabled: true api: auto

+6
source

Source: https://habr.com/ru/post/1210534/


All Articles