You are here

public function Test3::removeQueueItem in Coder 8.2

Parameters described by reference are OK.

Parameters

array &$form: The form array.

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

Return value

array A renderable array.

File

coder_sniffer/Drupal/Test/good/good.php, line 1589
This file contains all the valid notations for the drupal coding standard.

Class

Test3
Another test.

Code

public function removeQueueItem(array &$form, FormStateInterface $form_state) {
  $trigger = $form_state
    ->getTriggeringElement();
  $i = $trigger['#parents'][1];
  $queues = $form_state
    ->getValue('watch_queues', []);
  $queues[$i]['to_remove'] = 1;
  $form_state
    ->setValue('watch_queues', $queues);
  $this
    ->rebuild($form_state, $form);
  drupal_set_message($this
    ->t('Item will be removed permanently when configuration is saved.'));
  return StatusMessages::renderMessages(NULL);
}