Passed
Pull Request — master (#1834)
by
unknown
05:14
created

SeneddView::getSearchBox()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 21
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 17
nc 2
nop 1
dl 0
loc 21
rs 9.7
c 0
b 0
f 0
1
<?php
2
3
namespace MySociety\TheyWorkForYou\SectionView;
4
5
class SeneddView extends SectionView {
6
    protected $index_template = 'section/senedd_index';
7
8
    public function __construct() {
9
        if (LANGUAGE == 'cy') {
0 ignored issues
show
introduced by
The condition MySociety\TheyWorkForYou...onView\LANGUAGE == 'cy' is always false.
Loading history...
10
            $this->major = 11;
11
            $this->class = 'SENEDDCYLIST';
12
        } else {
13
            $this->major = 10;
14
            $this->class = 'SENEDDENLIST';
15
        }
16
        parent::__construct();
17
    }
18
19
    protected function display_front() {
20
        if (get_http_var('more')) {
21
            return parent::display_front();
22
        } else {
23
            $homepage = new \MySociety\TheyWorkForYou\Homepage\Wales();
24
            return $homepage->display();
25
        }
26
    }
27
28
    protected function front_content() {
29
        return $this->list->display('biggest_debates', ['days' => 30, 'num' => 20], 'none');
30
    }
31
32
    protected function getURLs($data) {
33
        $urls = [];
34
35
        $day = new \MySociety\TheyWorkForYou\Url('senedddebates');
36
        $urls['seneddday'] = $day;
37
        $urls['day'] = $day;
38
39
        return $urls;
40
    }
41
42
    protected function getSearchSections() {
43
        return [
44
            [ 'section' => 'wales' ],
45
        ];
46
    }
47
}
48