You are here

public function MigrateUpgradeForm::buildForm in Migrate Upgrade 8

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides ConfirmFormBase::buildForm

File

src/Form/MigrateUpgradeForm.php, line 668
Contains \Drupal\migrate_upgrade\Form\MigrateUpgradeForm.

Class

MigrateUpgradeForm
Defines a multi-step form for performing direct site upgrades.

Namespace

Drupal\migrate_upgrade\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $step = $form_state
    ->getValue('step', 'overview');
  switch ($step) {
    case 'overview':
      return $this
        ->buildOverviewForm($form, $form_state);
    case 'credentials':
      return $this
        ->buildCredentialForm($form, $form_state);
    case 'confirm':
      return $this
        ->buildConfirmForm($form, $form_state);
    default:
      drupal_set_message($this
        ->t('Unrecognized form step @step', [
        '@step' => $step,
      ]), 'error');
      return [];
  }
}