1 | <?php |
||
14 | class ConfigForm extends ConfigFormBase { |
||
15 | |||
16 | /** |
||
17 | * Name of the config being edited. |
||
18 | */ |
||
19 | const CONFIG_NAME = 'mongodb_watchdog.settings'; |
||
20 | |||
21 | protected $typed; |
||
22 | |||
23 | /** |
||
24 | * ConfigForm constructor. |
||
25 | * |
||
26 | * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory |
||
27 | * The core config.factory service. |
||
28 | * @param array $typed |
||
29 | * The type config for the module. |
||
30 | */ |
||
31 | public function __construct(ConfigFactoryInterface $config_factory, array $typed) { |
||
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | public static function create(ContainerInterface $container) { |
||
45 | |||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | public function buildForm(array $form, FormStateInterface $form_state) { |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public function submitForm(array &$form, FormStateInterface $form_state) { |
||
82 | |||
83 | /** |
||
84 | * Gets the configuration names that will be editable. |
||
85 | * |
||
86 | * @return array |
||
87 | * An array of configuration object names that are editable if called in |
||
88 | * conjunction with the trait's config() method. |
||
89 | */ |
||
90 | protected function getEditableConfigNames() { |
||
93 | |||
94 | /** |
||
95 | * Returns a unique string identifying the form. |
||
96 | * |
||
97 | * @return string |
||
98 | * The unique string identifying the form. |
||
99 | */ |
||
100 | public function getFormId() { |
||
103 | |||
104 | } |
||
105 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@return
annotation as described here.