switchUserListHelper = $container->get('devel.switch_user_list_helper'); $instance->formBuilder = $container->get('form_builder'); return $instance; } /** * {@inheritdoc} */ public function getFormId(): string { return 'devel_switchuser_page_form'; } /** * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state): array { if ($accounts = $this->switchUserListHelper->getUsers()) { $form['devel_links'] = $this->switchUserListHelper->buildUserList($accounts); $form['devel_form'] = $this->formBuilder->getForm(SwitchUserForm::class); } else { $this->messenger->addStatus('There are no user accounts present!'); } return $form; } /** * {@inheritdoc} */ public function validateForm(array &$form, FormStateInterface $form_state): void { // Nothing to do here. This is delegated to devel.switch via http call. } /** * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state): void { // Nothing to do here. This is delegated to devel.switch via http call. } }