4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Validator\Context;
14 use Symfony\Component\Translation\TranslatorInterface;
15 use Symfony\Component\Validator\Validator\ValidatorInterface;
18 * Creates new {@link ExecutionContext} instances.
20 * @author Bernhard Schussek <bschussek@gmail.com>
22 * @internal version 2.5. Code against ExecutionContextFactoryInterface instead.
24 class ExecutionContextFactory implements ExecutionContextFactoryInterface
27 private $translationDomain;
30 * Creates a new context factory.
32 * @param TranslatorInterface $translator The translator
33 * @param string|null $translationDomain The translation domain to
37 public function __construct(TranslatorInterface $translator, $translationDomain = null)
39 $this->translator = $translator;
40 $this->translationDomain = $translationDomain;
46 public function createContext(ValidatorInterface $validator, $root)
48 return new ExecutionContext(
52 $this->translationDomain