Passed
Pull Request — master (#1932)
by Struan
05:06
created

BaseView   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A format_body() 0 4 1
A has_edit_access() 0 4 1
1
<?php
2
3
namespace MySociety\TheyWorkForYou\GlossaryView;
4
5
class BaseView {
6
    protected function format_body($body): string {
7
        $Parsedown = new \Parsedown();
8
        $Parsedown->setSafeMode(true);
9
        return $Parsedown->text($body);
10
    }
11
12
    protected function has_edit_access(): bool {
13
        global $THEUSER;
14
15
        return $THEUSER->is_able_to('addterm');
16
    }
17
}
18