StubGlobalExecutionContext.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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\Tests\Fixtures;
  11. use Symfony\Component\Validator\ConstraintViolationList;
  12. use Symfony\Component\Validator\GlobalExecutionContextInterface;
  13. use Symfony\Component\Validator\ValidationVisitorInterface;
  14. /**
  15. * @author Bernhard Schussek <bschussek@gmail.com>
  16. *
  17. * @deprecated since version 2.5, to be removed in 3.0
  18. */
  19. class StubGlobalExecutionContext implements GlobalExecutionContextInterface
  20. {
  21. private $violations;
  22. private $root;
  23. private $visitor;
  24. public function __construct($root = null, ValidationVisitorInterface $visitor = null)
  25. {
  26. $this->violations = new ConstraintViolationList();
  27. $this->root = $root;
  28. $this->visitor = $visitor;
  29. }
  30. public function getViolations()
  31. {
  32. return $this->violations;
  33. }
  34. public function setRoot($root)
  35. {
  36. $this->root = $root;
  37. }
  38. public function getRoot()
  39. {
  40. return $this->root;
  41. }
  42. public function setVisitor(ValidationVisitorInterface $visitor)
  43. {
  44. $this->visitor = $visitor;
  45. }
  46. public function getVisitor()
  47. {
  48. return $this->visitor;
  49. }
  50. public function getValidatorFactory()
  51. {
  52. }
  53. public function getMetadataFactory()
  54. {
  55. }
  56. }