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

NiView::getSearchBox()   A

Complexity

Conditions 5
Paths 4

Size

Total Lines 25
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 19
nc 4
nop 1
dl 0
loc 25
rs 9.3222
c 0
b 0
f 0
1
<?php
2
3
namespace MySociety\TheyWorkForYou\SectionView;
4
5
class NiView extends SectionView {
6
    public $major = 5;
7
    protected $class = 'NILIST';
8
    protected $index_template = 'section/ni_index';
9
10
    protected function display_front() {
11
        if (get_http_var('more')) {
12
            return parent::display_front();
13
        } else {
14
            $homepage = new \MySociety\TheyWorkForYou\Homepage\NI();
15
            return $homepage->display();
16
        }
17
    }
18
19
    protected function front_content() {
20
        return $this->list->display('biggest_debates', ['days' => 30, 'num' => 20], 'none');
21
    }
22
23
    protected function getURLs($data) {
24
        $urls = [];
25
26
        $day = new \MySociety\TheyWorkForYou\Url('nidebates');
27
        $urls['niday'] = $day;
28
29
        $urls['day'] = $day;
30
31
        return $urls;
32
    }
33
34
    protected function getSearchSections() {
35
        return [
36
            [ 'section' => 'ni' ],
37
        ];
38
    }
39
}
40