ExecutionContextFactoryInterface.php 952 B

1234567891011121314151617181920212223242526272829303132333435
  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 mixed $root The root value of the validated
  26. * object graph
  27. *
  28. * @return ExecutionContextInterface The new execution context
  29. */
  30. public function createContext(ValidatorInterface $validator, $root);
  31. }