ExecutionContext.php
1 year ago
ExecutionContextFactory.php
1 year ago
ExecutionContextFactoryInterface.php
4 years ago
ExecutionContextInterface.php
1 year ago
index.php
3 years ago
ExecutionContextFactory.php
20 lines
| 1 | <?php |
| 2 | namespace MailPoetVendor\Symfony\Component\Validator\Context; |
| 3 | if (!defined('ABSPATH')) exit; |
| 4 | use MailPoetVendor\Symfony\Component\Validator\Validator\ValidatorInterface; |
| 5 | use MailPoetVendor\Symfony\Contracts\Translation\TranslatorInterface; |
| 6 | class ExecutionContextFactory implements ExecutionContextFactoryInterface |
| 7 | { |
| 8 | private $translator; |
| 9 | private $translationDomain; |
| 10 | public function __construct(TranslatorInterface $translator, ?string $translationDomain = null) |
| 11 | { |
| 12 | $this->translator = $translator; |
| 13 | $this->translationDomain = $translationDomain; |
| 14 | } |
| 15 | public function createContext(ValidatorInterface $validator, $root) |
| 16 | { |
| 17 | return new ExecutionContext($validator, $root, $this->translator, $this->translationDomain); |
| 18 | } |
| 19 | } |
| 20 |