You are here

public function ConfigForm::validateForm in Flysystem 8

Same name and namespace in other branches
  1. 3.x src/Form/ConfigForm.php \Drupal\flysystem\Form\ConfigForm::validateForm()
  2. 2.0.x src/Form/ConfigForm.php \Drupal\flysystem\Form\ConfigForm::validateForm()
  3. 3.0.x src/Form/ConfigForm.php \Drupal\flysystem\Form\ConfigForm::validateForm()

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/ConfigForm.php, line 86

Class

ConfigForm
Configure file system settings for this site.

Namespace

Drupal\flysystem\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  if ($form_state
    ->getValue('sync_from') === $form_state
    ->getValue('sync_to')) {
    $form_state
      ->setError($form['sync_from'], $this
      ->t('"Sync from" and "Sync to" cannot be the same scheme.'));
    $form_state
      ->setError($form['sync_to']);
  }
}