Skip to content

Commit

Permalink
fix code style errors
Browse files Browse the repository at this point in the history
  • Loading branch information
l0gicgate committed Aug 20, 2019
1 parent 8e0f835 commit aed55cf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Slim/App.php
Expand Up @@ -72,11 +72,13 @@ public function __construct(
$this->routeResolver = $routeResolver ?? new RouteResolver($this->routeCollector);
$routeRunner = new RouteRunner($this->routeResolver, $this->routeCollector->getRouteParser());

if ($middlewareDispatcher) {
if (!$middlewareDispatcher) {
$middlewareDispatcher = new MiddlewareDispatcher($routeRunner, $this->callableResolver, $container);
} else {
$middlewareDispatcher->seedMiddlewareStack($routeRunner);
}

$this->middlewareDispatcher = $middlewareDispatcher ?? new MiddlewareDispatcher($routeRunner, $this->callableResolver, $container);
$this->middlewareDispatcher = $middlewareDispatcher;
}

/**
Expand Down
9 changes: 8 additions & 1 deletion Slim/Factory/AppFactory.php
Expand Up @@ -124,7 +124,14 @@ public static function createFromContainer(ContainerInterface $container): App
? $container->get(MiddlewareDispatcherInterface::class)
: null;

return new App($responseFactory, $container, $callableResolver, $routeCollector, $routeResolver, $middlewareDispatcher);
return new App(
$responseFactory,
$container,
$callableResolver,
$routeCollector,
$routeResolver,
$middlewareDispatcher
);
}

/**
Expand Down

0 comments on commit aed55cf

Please sign in to comment.