private static function applyMiddleware(App $cdl, array $settings, \Slim\Route $route): void{
        if (isset($settings['middleware']) && !empty($settings['middleware'])) {
            foreach ($settings['middleware'] as $middleware) {
                if ($cdl->hasMiddleware($middleware)) {
                    /* @var $middleware Middleware */
                    $middleware = $cdl->getMiddleware($middleware);
                    $route->add($middleware::getInstance());
                }
            }
        }
    }