Test Failed
Push — master ( 5f9190...472f53 )
by Fran
02:50
created

Admin::index()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
namespace PSFS\controller\base;
4
5
use PSFS\base\types\AuthAdminController;
6
use PSFS\controller\UserController;
7
use PSFS\services\AdminServices;
8
9
/**
10
 * Class Admin
11
 * @package PSFS\controller
12
 * @domain ROOT
13
 */
14
abstract class Admin extends AuthAdminController
15
{
16
17
    const DOMAIN = 'ROOT';
18
19
    /**
20
     * @Injectable
21
     * @var \PSFS\base\config\Config Configuration service
22
     */
23
    protected $config;
24
    /**
25
     * @Injectable
26
     * @var \PSFS\services\AdminServices Admin service
27
     */
28
    protected $srv;
29
30
    /**
31
     * Método estático de login de administrador
32
     * @param string $route
33
     * @return string HTML
34
     * @throws \PSFS\base\exception\FormException
35
     */
36 1
    public static function staticAdminLogon($route = null)
0 ignored issues
show
Unused Code introduced by
The parameter $route is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

36
    public static function staticAdminLogon(/** @scrutinizer ignore-unused */ $route = null)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
37
    {
38 1
        if (file_exists(CONFIG_DIR . DIRECTORY_SEPARATOR . 'admins.json')) {
39
            return AdminServices::getInstance()->setAdminHeaders();
40
        } else {
41 1
            return UserController::showAdminManager();
42
        }
43
    }
44
45
    /**
46
     * Método que gestiona el menú de administración
47
     * @GET
48
     * @route /admin
49
     * @visible false
50
     * @return string|null
51
     */
52
    public function index()
53
    {
54
        return $this->render("index.html.twig");
55
    }
56
57
}
58