You are here

class ExecutionContextFactory in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/validator/Context/ExecutionContextFactory.php \Symfony\Component\Validator\Context\ExecutionContextFactory
  2. 8 core/lib/Drupal/Core/TypedData/Validation/ExecutionContextFactory.php \Drupal\Core\TypedData\Validation\ExecutionContextFactory
Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Context/ExecutionContextFactory.php \Symfony\Component\Validator\Context\ExecutionContextFactory

Creates new {@link ExecutionContext} instances.

@since 2.5

@author Bernhard Schussek <bschussek@gmail.com>

@internal You should not instantiate or use this class. Code against {@link ExecutionContextFactoryInterface} instead.

Hierarchy

Expanded class hierarchy of ExecutionContextFactory

2 files declare their use of ExecutionContextFactory
RecursiveValidator2Dot5ApiTest.php in vendor/symfony/validator/Tests/Validator/RecursiveValidator2Dot5ApiTest.php
ValidatorBuilder.php in vendor/symfony/validator/ValidatorBuilder.php

File

vendor/symfony/validator/Context/ExecutionContextFactory.php, line 27

Namespace

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

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

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

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

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

}

Members