Passed
Pull Request — 8.x-2.x (#26)
by Frédéric G.
02:49
created

EventTemplateSettingsForm   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 41
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getFormId() 0 3 1
A submitForm() 0 3 1
A buildForm() 0 4 1
1
<?php
2
3
namespace Drupal\mongodb_watchdog\Form;
4
5
use Drupal\Core\Form\FormBase;
6
use Drupal\Core\Form\FormStateInterface;
7
8
/**
9
 * Class EventTemplateSettingsForm.
10
 *
11
 * @package Drupal\mongodb_watchdog\Form
12
 *
13
 * @ingroup mongodb_watchdog
14
 */
15
class EventTemplateSettingsForm extends FormBase {
16
17
  /**
18
   * Returns a unique string identifying the form.
19
   *
20
   * @return string
21
   *   The unique string identifying the form.
22
   */
23
  public function getFormId() {
24
    return 'EventTemplate_settings';
25
  }
26
27
  /**
28
   * Form submission handler.
29
   *
30
   * @param array $form
31
   *   An associative array containing the structure of the form.
32
   * @param \Drupal\Core\Form\FormStateInterface $form_state
33
   *   The current state of the form.
34
   */
35
  public function submitForm(array &$form, FormStateInterface $form_state) {
36
    // Empty implementation of the abstract submit class.
37
  }
38
39
  /**
40
   * Defines the settings form for Event template entities.
41
   *
42
   * @param array $form
43
   *   An associative array containing the structure of the form.
44
   * @param \Drupal\Core\Form\FormStateInterface $form_state
45
   *   The current state of the form.
46
   *
47
   * @return array
48
   *   Form definition array.
49
   */
50
  public function buildForm(array $form, FormStateInterface $form_state) {
51
    $form['EventTemplate_settings']['#markup'] = 'Settings form for Event template entities. Manage field settings here.';
52
    return $form;
53
  }
54
55
}
56