phpvalidationsymfonysymfony-2.4symfony-2.5

Has anyone else encountered ExecutionContext error for annotation validation from symfony 2.4 to 2.5?


... must be an instance of Symfony/Component/Validator/ExecutionContext, instance of Symfony/Component/Validator/Context/LegacyExecutionContext given ...


Solution

  • From the source, you can see it is deprecated since V2.5. You will indeed have to use ExecutionContext :

    https://github.com/symfony/Validator/blob/2.5/Context/LegacyExecutionContext.php#L25

    @deprecated Implemented for backwards compatibility with Symfony < 2.5. To be removed in Symfony 3.0.