Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x

ExecutionContextFactory.php

Same filename in this branch
  1. 11.1.x vendor/symfony/validator/Context/ExecutionContextFactory.php

Namespace

Drupal\Core\Validation

File

core/lib/Drupal/Core/Validation/ExecutionContextFactory.php

View source
<?php

namespace Drupal\Core\Validation;

use Symfony\Component\Validator\Context\ExecutionContextFactoryInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;

/**
 * Defines an execution factory for the Symfony validator.
 *
 * We do not use the factory provided by Symfony as it is marked internal.
 */
class ExecutionContextFactory implements ExecutionContextFactoryInterface {
    
    /**
     * Constructs a new ExecutionContextFactory instance.
     *
     * @param \Drupal\Core\Validation\TranslatorInterface $translator
     *   The translator instance.
     * @param string|null $translationDomain
     *   (optional) The translation domain.
     */
    public function __construct(TranslatorInterface $translator, ?string $translationDomain = NULL) {
    }
    
    /**
     * {@inheritdoc}
     */
    public function createContext(ValidatorInterface $validator, mixed $root) : ExecutionContextInterface {
        return new ExecutionContext($validator, $root, $this->translator, $this->translationDomain);
    }

}

Classes

Title Deprecated Summary
ExecutionContextFactory Defines an execution factory for the Symfony validator.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal