1 | <?php |
||
18 | abstract class Admin extends AuthAdminController |
||
19 | { |
||
20 | |||
21 | const DOMAIN = 'ROOT'; |
||
22 | |||
23 | /** |
||
24 | * @Inyectable |
||
25 | * @var \PSFS\base\config\Config Configuration service |
||
26 | */ |
||
27 | protected $config; |
||
28 | /** |
||
29 | * @Inyectable |
||
30 | * @var \PSFS\services\AdminServices Admin service |
||
31 | */ |
||
32 | protected $srv; |
||
33 | |||
34 | /** |
||
35 | * Wrapper de asignación de los menus |
||
36 | * @return array |
||
37 | */ |
||
38 | protected function getMenu() |
||
42 | |||
43 | /** |
||
44 | * Método estático de login de administrador |
||
45 | * @param string $route |
||
|
|||
46 | * @return string HTML |
||
47 | * @throws \PSFS\base\exception\FormException |
||
48 | */ |
||
49 | 1 | public static function staticAdminLogon($route = null) |
|
50 | { |
||
51 | 1 | if (file_exists(CONFIG_DIR . DIRECTORY_SEPARATOR . 'admins.json')) { |
|
52 | if ('login' !== Config::getInstance()->get('admin_login')) { |
||
53 | return AdminServices::getInstance()->setAdminHeaders(); |
||
54 | } else { |
||
55 | $form = new LoginForm(); |
||
56 | $form->setData(array("route" => $route)); |
||
57 | $form->build(); |
||
58 | $tpl = Template::getInstance(); |
||
59 | $tpl->setPublicZone(true); |
||
60 | return $tpl->render("login.html.twig", array( |
||
61 | 'form' => $form, |
||
62 | )); |
||
63 | } |
||
64 | } else { |
||
65 | 1 | return UserController::showAdminManager(); |
|
66 | } |
||
67 | } |
||
68 | |||
69 | /** |
||
70 | * Método que gestiona el menú de administración |
||
71 | * @GET |
||
72 | * @route /admin |
||
73 | * @visible false |
||
74 | * @return string|null |
||
75 | */ |
||
76 | public function index() |
||
80 | |||
81 | } |
||
82 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.