Completed
Push — master ( 9b78f7...5dcb4f )
by Andreas
08:15 queued 03:39
created

Admin::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
nc 2
nop 0
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace dokuwiki\Menu\Item;
4
5
/**
6
 * Class Admin
7
 *
8
 * Opens the Admin screen. Only shown to managers or above
9
 */
10
class Admin extends AbstractItem {
11
12
    /** @inheritdoc */
13
    public function __construct() {
14
        global $INFO;
15
        parent::__construct();
16
17
        $this->svg = DOKU_INC . 'lib/images/menu/settings.svg';
18
19
        if(!$INFO['ismanager']) {
20
            throw new \RuntimeException("admin is for managers only");
21
        }
22
    }
23
24
}
25