Passed
Push — main ( 7af4bb...131f20 )
by Rafael
58:13
created

ConfigController   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A doIndex() 0 13 3
A doSave() 0 4 1
1
<?php
2
3
/* Copyright (C) 2024       Rafael San José         <[email protected]>
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation; either version 3 of the License, or
8
 * any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
 */
18
19
namespace Modules\Admin\Controller;
20
21
use Alxarafe\Base\Controller\ViewController;
22
23
class ConfigController extends ViewController
24
{
25
26
    public function doIndex(): bool
27
    {
28
        /**
29
         * TODO: The value of this variable will be filled in when the roles
30
         * are correctly implemented.
31
         */
32
        $restricted_access = false;
33
34
        $this->template = 'page/config';
35
        if (isset($this->config) && $restricted_access) {
36
            $this->template = 'page/forbidden';
37
        }
38
        return true;
39
    }
40
41
    public function doSave():bool
42
    {
43
        dump($_POST);
44
        return false;
45
    }
46
}
47