Code Duplication    Length = 12-12 lines in 2 locations

modules/mongodb_watchdog/mongodb_watchdog.admin.inc 1 location

@@ 65-76 (lines=12) @@
62
    )),
63
  );
64
65
  foreach ($filters as $key => $filter) {
66
    $form['filters']['status'][$key] = array(
67
      '#title' => check_plain($filter['title']),
68
      '#type' => 'select',
69
      '#multiple' => TRUE,
70
      '#size' => 8,
71
      '#options' => $filter['options'],
72
    );
73
    if (!empty($_SESSION['mongodb_watchdog_overview_filter'][$key])) {
74
      $form['filters']['status'][$key]['#default_value'] = $_SESSION['mongodb_watchdog_overview_filter'][$key];
75
    }
76
  }
77
78
  $form['filters']['buttons']['submit'] = array(
79
    '#type' => 'submit',

modules/mongodb_watchdog/src/Form/MongodbWatchdogFilterForm.php 1 location

@@ 31-42 (lines=12) @@
28
      '#title' => $this->t('Filter log messages'),
29
      '#open' => TRUE,
30
    );
31
    foreach ($filters as $key => $filter) {
32
      $form['filters']['status'][$key] = array(
33
        '#title' => $filter['title'],
34
        '#type' => 'select',
35
        '#multiple' => TRUE,
36
        '#size' => 8,
37
        '#options' => $filter['options'],
38
      );
39
      if (!empty($_SESSION['mongodb_watchdog_overview_filter'][$key])) {
40
        $form['filters']['status'][$key]['#default_value'] = $_SESSION['dblog_overview_filter'][$key];
41
      }
42
    }
43
44
    $form['filters']['actions'] = array(
45
      '#type' => 'actions',