From 18fd73a899602a473044013854a354254062ebd4 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 12 Aug 2018 00:08:52 +0200 Subject: Moved middleware to application config --- src/Application.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/Application.php') 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; + } } -- cgit v1.2.3-54-g00ecf