From 2dcb7cc2de448c664bbc9a7112f9cb13dc15c516 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Mon, 8 Oct 2018 21:15:56 +0200 Subject: Replaced some global `$user` variables --- src/helpers.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/helpers.php b/src/helpers.php index 64ca9ec8..111141e4 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -3,10 +3,11 @@ use Engelsystem\Application; use Engelsystem\Config\Config; +use Engelsystem\Helpers\Authenticator; use Engelsystem\Helpers\Translator; use Engelsystem\Http\Request; use Engelsystem\Http\Response; -use Engelsystem\Http\UrlGenerator; +use Engelsystem\Http\UrlGeneratorInterface; use Engelsystem\Renderer\Renderer; use Symfony\Component\HttpFoundation\Session\SessionInterface; @@ -16,13 +17,21 @@ use Symfony\Component\HttpFoundation\Session\SessionInterface; * @param string $id * @return mixed|Application */ -function app($instance_id = null) +function app($id = null) { - if (is_null($instance_id)) { + if (is_null($id)) { return Application::getInstance(); } - return Application::getInstance()->get($instance_id); + return Application::getInstance()->get($id); +} + +/** + * @return Authenticator + */ +function auth() +{ + return app('authenticator'); } /** -- cgit v1.2.3-54-g00ecf