public function registerMiddleware($middlewareInstance)
    {
        if (isset(class_uses($middlewareInstance)['Nf\Middleware\Pre'])) {
            $key = self::MIDDLEWARE_PRE;
        } else {
            $key = self::MIDDLEWARE_POST;
        }
        // adds the middleware
        $this->registeredMiddlewares[$key][] = $middlewareInstance;
    }
public function registerMiddleware($middlewareInstance)
    {
        if (isset(class_uses($middlewareInstance)['Nf\Middleware\Pre'])) {
            $key = self::MIDDLEWARE_PRE;
        } else {
            $key = self::MIDDLEWARE_POST;
        }
        // adds the middleware
        $this->registeredMiddlewares[$key][] = $middlewareInstance;
    }
public function registerMiddleware ( $ middlewareInstance ) { if ( isset ( class_uses ( $ middlewareInstance ) [ 'Nf\Middleware\Pre' ] ) ) { $ key = self :: MIDDLEWARE_PRE ; } else { $ key = self :: MIDDLEWARE_POST ; } // adds the middleware $ this -> registeredMiddlewares [ $ key ] [ ] = $ middlewareInstance ; }
registers a middleware programmatically and not through a route
registers a middleware programmatically and not through a route