f3ab3dd68a740744cc286873ad10db9341fdd644
[yaffs-website] / validator / Context / ExecutionContextFactoryInterface.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\Validator\Context;
13
14 use Symfony\Component\Validator\Validator\ValidatorInterface;
15
16 /**
17  * Creates instances of {@link ExecutionContextInterface}.
18  *
19  * You can use a custom factory if you want to customize the execution context
20  * that is passed through the validation run.
21  *
22  * @author Bernhard Schussek <bschussek@gmail.com>
23  */
24 interface ExecutionContextFactoryInterface
25 {
26     /**
27      * Creates a new execution context.
28      *
29      * @param ValidatorInterface $validator The validator
30      * @param mixed              $root      The root value of the validated
31      *                                      object graph
32      *
33      * @return ExecutionContextInterface The new execution context
34      */
35     public function createContext(ValidatorInterface $validator, $root);
36 }