[COMMON][SECURITY][WRAPPER] Added security service static wrapper and Common::getUser

This commit is contained in:
Hugo Sales
2020-07-23 23:33:00 +00:00
committed by Hugo Sales
parent 97fd7620e7
commit c0da90bd3e
3 changed files with 62 additions and 2 deletions

View File

@@ -32,6 +32,8 @@ namespace App\Util;
use App\Core\DB\DB;
use App\Core\Router;
use App\Core\Security;
use Symfony\Component\Security\Core\User\UserInterface;
abstract class Common
{
@@ -59,6 +61,11 @@ abstract class Common
DB::flush();
}
public static function user(): UserInterface
{
return Security::getUser();
}
/**
* Is the given string identical to a system path or route?
* This could probably be put in some other class, but at