Commit 459724a5 authored by TravisCarden's avatar TravisCarden

By TravisCarden: Changed type hinting of $form_state per #2310411.

parent 66730ea1
......@@ -8,6 +8,7 @@
namespace Drupal\checklistapi\Form;
use Drupal\Core\Form\ConfirmFormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Provides a form to clear saved progress for a given checklist.
......@@ -68,7 +69,7 @@ class ChecklistapiChecklistClearForm extends ConfirmFormBase {
/**
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state, $checklist_id = NULL) {
public function buildForm(array $form, FormStateInterface $form_state, $checklist_id = NULL) {
$this->checklist = checklistapi_checklist_load($checklist_id);
$form['#checklist'] = $this->checklist;
return parent::buildForm($form, $form_state);
......@@ -77,7 +78,7 @@ class ChecklistapiChecklistClearForm extends ConfirmFormBase {
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, array &$form_state) {
public function submitForm(array &$form, FormStateInterface $form_state) {
// Clear saved progress.
$form['#checklist']->clearSavedProgress();
......
......@@ -9,6 +9,7 @@ namespace Drupal\checklistapi\Form;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Form\FormInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element;
/**
......@@ -26,7 +27,7 @@ class ChecklistapiChecklistForm implements FormInterface {
/**
* {@inheritdoc}
*/
public function buildForm(array $form, array &$form_state, $checklist_id = NULL) {
public function buildForm(array $form, FormStateInterface $form_state, $checklist_id = NULL) {
$form['#checklist'] = $checklist = checklistapi_checklist_load($checklist_id);
$user_has_edit_access = $checklist->userHasAccess('edit');
......@@ -176,13 +177,14 @@ class ChecklistapiChecklistForm implements FormInterface {
/**
* {@inheritdoc}
*/
public function validateForm(array &$form, array &$form_state) {}
public function validateForm(array &$form, FormStateInterface $form_state) {}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, array &$form_state) {
$form['#checklist']->saveProgress($form_state['values']['checklistapi']);
public function submitForm(array &$form, FormStateInterface $form_state) {
$values = $form_state->getValue('checklistapi');
$form['#checklist']->saveProgress($values);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment