You are here

class LegacyExecutionContextFactory in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Context/LegacyExecutionContextFactory.php \Symfony\Component\Validator\Context\LegacyExecutionContextFactory

Creates new {@link LegacyExecutionContext} instances.

Implemented for backward compatibility with Symfony < 2.5.

@since 2.5

@author Bernhard Schussek <bschussek@gmail.com>

Hierarchy

Expanded class hierarchy of LegacyExecutionContextFactory

Deprecated

since version 2.5, to be removed in 3.0.

2 files declare their use of LegacyExecutionContextFactory
LegacyValidator2Dot5ApiTest.php in vendor/symfony/validator/Tests/Validator/LegacyValidator2Dot5ApiTest.php
LegacyValidatorLegacyApiTest.php in vendor/symfony/validator/Tests/Validator/LegacyValidatorLegacyApiTest.php

File

vendor/symfony/validator/Context/LegacyExecutionContextFactory.php, line 31

Namespace

Symfony\Component\Validator\Context
View source
class LegacyExecutionContextFactory implements ExecutionContextFactoryInterface {

  /**
   * @var MetadataFactoryInterface
   */
  private $metadataFactory;

  /**
   * @var TranslatorInterface
   */
  private $translator;

  /**
   * @var string|null
   */
  private $translationDomain;

  /**
   * Creates a new context factory.
   *
   * @param MetadataFactoryInterface $metadataFactory   The metadata factory
   * @param TranslatorInterface      $translator        The translator
   * @param string|null              $translationDomain The translation domain
   *                                                    to use for translating
   *                                                    violation messages
   */
  public function __construct(MetadataFactoryInterface $metadataFactory, TranslatorInterface $translator, $translationDomain = null) {
    $this->metadataFactory = $metadataFactory;
    $this->translator = $translator;
    $this->translationDomain = $translationDomain;
  }

  /**
   * {@inheritdoc}
   */
  public function createContext(ValidatorInterface $validator, $root) {
    return new LegacyExecutionContext($validator, $root, $this->metadataFactory, $this->translator, $this->translationDomain);
  }

}

Members