File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 22
33namespace Bermuda \Router ;
44
5+ use Bermuda \MiddlewareFactory \MiddlewareFactoryInterface ;
6+ use Bermuda \Router \Middleware \DispatchRouteMiddleware ;
7+ use Bermuda \Router \Middleware \MatchRouteMiddleware ;
8+ use Psr \Container \ContainerInterface ;
9+
510final class ConfigProvider extends \Bermuda \Config \ConfigProvider
611{
712 /**
813 * @inheritDoc
914 */
1015 protected function getFactories (): array
1116 {
12- return [Router::class => '\Bermuda\Router\Router::withDefaults ' ];
17+ return [
18+ Router::class => '\Bermuda\Router\Router::withDefaults ' ,
19+ MatchRouteMiddleware::class => static function (ContainerInterface $ container ): MatchRouteMiddleware {
20+ return new MatchRouteMiddleware (
21+ $ container ->get (MiddlewareFactoryInterface::class),
22+ $ container ->get (Router::class)
23+ );
24+ }
25+ ];
26+ }
27+
28+ protected function getInvokables (): array
29+ {
30+ return [DispatchRouteMiddleware::class];
1331 }
1432}
You can’t perform that action at this time.
0 commit comments