Warm tip: This article is reproduced from stackoverflow.com, please click
forms php symfony doctrine-orm symfony-2.7

Symfony2 Can't inherit abstract function Validator\ValidatorInterface::validate() (previously declar

发布于 2020-03-29 21:03:00

If I use the symfony console command generate:doctrine:crud with --write parameter I get an auto-generated controller working only in the indexAction route, but not in the others (newAction, deleteAction, updateAction). I think the problem is in the form creation. The resulting error is the following one:

Compile Error: Can't inherit abstract function Symfony\Component\Validator\ValidatorInterface::validate() (previously declared abstract in Symfony\Component\Validator\Validator\ValidatorInterface)

Server Error - FatalErrorException500 Internal in vendor/symfony/symfony/src/Symfony/Component/Validator/Validator/RecursiveValidator.php at line 31

I don't know, how to solve this problem.

Questioner
tonygatta
Viewed
63
tonygatta 2020-01-31 18:54

The only way to solve this problem is to change ValidatorInterface or to run almost PHP 5.6