Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Form/FormValidator.php \Drupal\Core\Form\FormValidator::__construct()
  2. 9 core/lib/Drupal/Core/Form/FormValidator.php \Drupal\Core\Form\FormValidator::__construct()

Constructs a new FormValidator.

Parameters

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

\Drupal\Core\StringTranslation\TranslationInterface $string_translation: The string translation service.

\Drupal\Core\Access\CsrfTokenGenerator $csrf_token: The CSRF token generator.

\Psr\Log\LoggerInterface $logger: A logger instance.

\Drupal\Core\Form\FormErrorHandlerInterface $form_error_handler: The form error handler.

File

core/lib/Drupal/Core/Form/FormValidator.php, line 62

Class

FormValidator
Provides validation of form submissions.

Namespace

Drupal\Core\Form

Code

public function __construct(RequestStack $request_stack, TranslationInterface $string_translation, CsrfTokenGenerator $csrf_token, LoggerInterface $logger, FormErrorHandlerInterface $form_error_handler) {
  $this->requestStack = $request_stack;
  $this->stringTranslation = $string_translation;
  $this->csrfToken = $csrf_token;
  $this->logger = $logger;
  $this->formErrorHandler = $form_error_handler;
}