public function VarnishAdminForm::validateForm in Varnish 8
Form validation handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides FormBase::validateForm
File
- src/
Form/ VarnishAdminForm.php, line 149
Class
Namespace
Drupal\varnish\FormCode
public function validateForm(array &$form, FormStateInterface $form_state) {
$socket_timeout = $form_state
->getValue('varnish_socket_timeout');
if (!is_numeric($socket_timeout) || $socket_timeout < 0) {
$form_state
->setErrorByName('varnish_socket_timeout', $this
->t('Varnish connection timeout must be a positive number.'));
}
}