summaryrefslogtreecommitdiff
path: root/src/Application.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-08-12 00:08:52 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-08-19 13:59:57 +0200
commit18fd73a899602a473044013854a354254062ebd4 (patch)
treea5202fe90c8d08e3c7c06579a55074160e7d5463 /src/Application.php
parentf3b3b6683ca90b70ec4d4daae002dc0caac9ebdd (diff)
Moved middleware to application config
Diffstat (limited to 'src/Application.php')
-rw-r--r--src/Application.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Application.php b/src/Application.php
index 68ce9e33..6644a6cf 100644
--- a/src/Application.php
+++ b/src/Application.php
@@ -7,6 +7,7 @@ use Engelsystem\Container\Container;
use Engelsystem\Container\ServiceProvider;
use Illuminate\Container\Container as IlluminateContainer;
use Psr\Container\ContainerInterface;
+use Psr\Http\Server\MiddlewareInterface;
class Application extends Container
{
@@ -16,6 +17,9 @@ class Application extends Container
/** @var bool */
protected $isBootstrapped = false;
+ /** @var MiddlewareInterface[]|string[] */
+ protected $middleware;
+
/**
* Registered service providers
*
@@ -85,6 +89,8 @@ class Application extends Container
foreach ($config->get('providers', []) as $provider) {
$this->register($provider);
}
+
+ $this->middleware = $config->get('middleware', []);
}
foreach ($this->serviceProviders as $provider) {
@@ -136,4 +142,12 @@ class Application extends Container
{
return $this->isBootstrapped;
}
+
+ /**
+ * @return MiddlewareInterface[]|string[]
+ */
+ public function getMiddleware()
+ {
+ return $this->middleware;
+ }
}