Zend\Expressive\Container\ApplicationFactory::injectRoutesAndPipeline PHP Method

injectRoutesAndPipeline() private method

Injects routes and the middleware pipeline into the application.
private injectRoutesAndPipeline ( Application $app, Interop\Container\ContainerInterface $container )
$app Zend\Expressive\Application
$container Interop\Container\ContainerInterface
    private function injectRoutesAndPipeline(Application $app, ContainerInterface $container)
    {
        $config = $container->has('config') ? $container->get('config') : [];
        $pipelineCreated = false;
        if (isset($config['middleware_pipeline']) && is_array($config['middleware_pipeline'])) {
            $pipelineCreated = $this->injectPipeline($config['middleware_pipeline'], $app);
        }
        if (isset($config['routes']) && is_array($config['routes'])) {
            $this->injectRoutes($config['routes'], $app);
            if (!$pipelineCreated) {
                $app->pipeRoutingMiddleware();
                $app->pipeDispatchMiddleware();
            }
        }
    }