ExecutionContextFactoryInterface.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. * @since 2.5
  19. *
  20. * @author Bernhard Schussek <bschussek@gmail.com>
  21. */
  22. interface ExecutionContextFactoryInterface
  23. {
  24. /**
  25. * Creates a new execution context.
  26. *
  27. * @param ValidatorInterface $validator The validator
  28. * @param mixed $root The root value of the validated
  29. * object graph
  30. *
  31. * @return ExecutionContextInterface The new execution context
  32. */
  33. public function createContext(ValidatorInterface $validator, $root);
  34. }