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

Admin   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 9
c 2
b 0
f 0
dl 0
loc 41
ccs 3
cts 6
cp 0.5
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 3 1
A staticAdminLogon() 0 6 2
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