for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PSFS\controller\base;
use PSFS\base\config\Config;
use PSFS\base\config\LoginForm;
use PSFS\base\Router;
use PSFS\base\Template;
use PSFS\base\types\AuthAdminController;
use PSFS\controller\UserController;
use PSFS\services\AdminServices;
/**
* Class Admin
* @package PSFS\controller
* @domain ROOT
*/
abstract class Admin extends AuthAdminController
{
const DOMAIN = 'ROOT';
* @Inyectable
* @var \PSFS\base\config\Config Configuration service
protected $config;
* @var \PSFS\services\AdminServices Admin service
protected $srv;
* Método estático de login de administrador
* @param string $route
$route
string|null
This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.
@param
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.
* @return string HTML
* @throws \PSFS\base\exception\FormException
public static function staticAdminLogon($route = null)
if (file_exists(CONFIG_DIR . DIRECTORY_SEPARATOR . 'admins.json')) {
if ('login' !== Config::getInstance()->get('admin_login')) {
return AdminServices::getInstance()->setAdminHeaders();
} else {
$form = new LoginForm();
$form->setData(array("route" => $route));
$form->build();
$tpl = Template::getInstance();
$tpl->setPublicZone(true);
return $tpl->render("login.html.twig", array(
'form' => $form,
));
}
return UserController::showAdminManager();
* Método que gestiona el menú de administración
* @GET
* @route /admin
* @visible false
* @return string|null
public function index()
return $this->render("index.html.twig");
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.