ExecutionContextFactoryInterface.php 1.0 KB

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