-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Description
NOTE: This issue is part of the "SymfonyCon 2014 Madrid Hackday" effort to add logs for every 2.7 deprecated feature. This is needed before removing those features in 3.0 version. Please, add you name in a comment of this issue if you are going to work on this.
If you need it, this Gist explains how to generate the deprecation note:
https://gist.github.com/javiereguiluz/a5514ec6cde2a63be441
The option "methods
" of the Callback
constraint was removed. You should
use the option "callback
" instead. If you have multiple callbacks, add
multiple callback constraints instead.
Before (YAML):
constraints:
- Callback: [firstCallback, secondCallback]
After (YAML):
constraints:
- Callback: firstCallback
- Callback: secondCallback
When using annotations, you can now put the Callback
constraint directly on
the method that should be executed.
Before (Annotations):
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\ExecutionContextInterface;
/**
* @Assert\Callback({"callback"})
*/
class MyClass
{
public function callback(ExecutionContextInterface $context)
{
// ...
}
}
After (Annotations):
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\ExecutionContextInterface;
class MyClass
{
/**
* @Assert\Callback
*/
public function callback(ExecutionContextInterface $context)
{
// ...
}
}