Passed
Pull Request — master (#600)
by Mathias
13:24
created

FeaturedCompaniesSearchForm   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 6
eloc 14
c 1
b 0
f 1
dl 0
loc 24
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 21 6
1
<?php
2
3
/**
4
 * YAWIK
5
 *
6
 * @see       https://github.com/cross-solution/YAWIK for the canonical source repository
7
 * @copyright https://github.com/cross-solution/YAWIK/blob/master/COPYRIGHT
8
 * @license   https://github.com/cross-solution/YAWIK/blob/master/LICENSE
9
 */
10
11
declare(strict_types=1);
12
13
namespace Organizations\Form;
14
15
use Core\Form\SearchForm;
16
use Organizations\Form\Element\FeaturedCompaniesFilterRadio;
17
18
/**
19
 * TODO: description
20
 *
21
 * @author Mathias Gelhausen
22
 * TODO: write tests
23
 */
24
class FeaturedCompaniesSearchForm extends SearchForm
25
{
26
27
    public function init()
28
    {
29
        $this->setName($this->getOption('name') ?: 'searchform');
30
31
        $this->addTextElement(
32
            $this->getOption('text_name') ?: 'q',
33
            $this->getOption('text_label') ?: /*@translate*/ 'Search',
34
            $this->getOption('text_placeholder') ?: /*@translate*/ 'Search query',
35
            $this->getOption('text_span') ?: 12,
36
            50,
37
            true
38
        );
39
40
        $this->add([
41
            'type' => FeaturedCompaniesFilterRadio::class
42
        ]);
43
44
        $this->addButton(/*@translate*/ 'Search', -1000, 'submit');
45
        $this->addButton(/*@translate*/ 'Clear', -1001, 'reset');
46
47
        $this->addElements();
48
    }
49
}
50