SearchForm::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 5
dl 0
loc 12
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * class SearchForm|Firesphere\SolrSearch\Forms basic search form
4
 *
5
 * @package Firesphere\Solr\Search
6
 * @author Simon `Firesphere` Erkelens; Marco `Sheepy` Hermo
7
 * @copyright Copyright (c) 2018 - now() Firesphere & Sheepy
8
 */
9
10
namespace Firesphere\SolrSearch\Forms;
11
12
use SilverStripe\Control\RequestHandler;
13
use SilverStripe\Forms\FieldList;
14
use SilverStripe\Forms\Form;
15
use SilverStripe\Forms\Validator;
16
17
/**
18
 * Class SolrSearchForm
19
 * Basic form to start searching
20
 *
21
 * @package Firesphere\Solr\Search
22
 */
23
class SearchForm extends Form
24
{
25
    /**
26
     * SolrSearchForm constructor.
27
     *
28
     * @param RequestHandler|null $controller
29
     * @param string $name
30
     * @param FieldList|null $fields
31
     * @param FieldList|null $actions
32
     * @param Validator|null $validator
33
     */
34 1
    public function __construct(
35
        RequestHandler $controller = null,
36
        $name = self::DEFAULT_NAME,
37
        FieldList $fields = null,
38
        FieldList $actions = null,
39
        Validator $validator = null
40
    ) {
41 1
        parent::__construct($controller, $name, $fields, $actions, $validator);
42
43 1
        $this->setFormMethod('GET');
44
45 1
        $this->disableSecurityToken();
46 1
    }
47
}
48