summaryrefslogtreecommitdiff
path: root/src/helpers.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-10-08 21:15:56 +0200
committermsquare <msquare@notrademark.de>2018-10-31 13:43:23 +0100
commit2dcb7cc2de448c664bbc9a7112f9cb13dc15c516 (patch)
treee409cf77e97c91ff27b0e61f2a982519fdfdf76f /src/helpers.php
parentd15946df2dfb0ae2f0ca9371e5c8071df91ab45a (diff)
Replaced some global `$user` variables
Diffstat (limited to 'src/helpers.php')
-rw-r--r--src/helpers.php17
1 files changed, 13 insertions, 4 deletions
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');
}
/**