LegacyExecutionContext.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. @trigger_error('The '.__NAMESPACE__.'\LegacyExecutionContext class is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
  12. use Symfony\Component\Translation\TranslatorInterface;
  13. use Symfony\Component\Validator\MetadataFactoryInterface;
  14. use Symfony\Component\Validator\Validator\ValidatorInterface;
  15. /**
  16. * An execution context that is compatible with the legacy API (< 2.5).
  17. *
  18. * @since 2.5
  19. *
  20. * @author Bernhard Schussek <bschussek@gmail.com>
  21. *
  22. * @deprecated since version 2.5, to be removed in 3.0.
  23. */
  24. class LegacyExecutionContext extends ExecutionContext
  25. {
  26. /**
  27. * @var MetadataFactoryInterface
  28. */
  29. private $metadataFactory;
  30. /**
  31. * Creates a new context.
  32. *
  33. * @see ExecutionContext::__construct()
  34. *
  35. * @internal Called by {@link LegacyExecutionContextFactory}. Should not be used
  36. * in user code.
  37. */
  38. public function __construct(ValidatorInterface $validator, $root, MetadataFactoryInterface $metadataFactory, TranslatorInterface $translator, $translationDomain = null)
  39. {
  40. parent::__construct(
  41. $validator,
  42. $root,
  43. $translator,
  44. $translationDomain
  45. );
  46. $this->metadataFactory = $metadataFactory;
  47. }
  48. }