Total Complexity | 4 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | class QuickSearchController extends Controller |
||
18 | { |
||
19 | private static $url_segment = 'admin/quicksearch'; |
||
20 | |||
21 | private static $allowed_actions = [ |
||
22 | 'index' => 'ADMIN', |
||
23 | 'getform' => 'ADMIN', |
||
24 | 'doform' => 'ADMIN', |
||
25 | ]; |
||
26 | |||
27 | public function Link($action = '') |
||
28 | { |
||
29 | return '/' . $this->Config()->get('url_segment') . '/' . $action; |
||
30 | } |
||
31 | |||
32 | |||
33 | public function FormProvider(): Form |
||
34 | { |
||
35 | $form = new Form( |
||
36 | $this, |
||
37 | 'FormProvider', |
||
38 | FieldList::create( |
||
39 | TextField::create('Keywords', 'Keyword(s)', $this->getKeywords() ?? '') |
||
40 | ->setAttribute('placeholder', 'e.g. agreement') |
||
41 | ), |
||
42 | FieldList::create( |
||
43 | FormAction::create('doSearch', 'Search') |
||
44 | ) |
||
45 | ); |
||
46 | $form->setFormMethod('GET'); |
||
47 | $form->setFormAction($this->Link()); |
||
48 | $form->disableSecurityToken(); |
||
49 | return $form; |
||
50 | } |
||
51 | |||
52 | public function FormProcessor(Form $form, array $data): array |
||
55 | } |
||
56 | public function getKeywords() |
||
59 | } |
||
60 | } |
||
61 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.