public function addRouteMiddleware(string $name): void
    {
        if (!array_key_exists($name, $this->getConfigRouteMiddlewares())) {
            throw new InvalidArgumentException('The middleware [' . $name . '] does not exists.');
        }

        $this->routeMiddlewares[] = $this->getConfigRouteMiddlewares()[$name];
    }
public function addRouteMiddleware(string $name): void
    {
        if (!array_key_exists($name, $this->getConfigRouteMiddlewares())) {
            throw new InvalidArgumentException('The middleware [' . $name . '] does not exists.');
        }

        $this->routeMiddlewares[] = $this->getConfigRouteMiddlewares()[$name];
    }
public function addRouteMiddleware ( string $ name ) : void { if ( ! array_key_exists ( $ name , $ this -> getConfigRouteMiddlewares ( ) ) ) { throw new InvalidArgumentException ( 'The middleware [' . $ name . '] does not exists.' ) ; } $ this -> routeMiddlewares [ ] = $ this -> getConfigRouteMiddlewares ( ) [ $ name ] ; }
Add a route middleware to the list of executed middlewares.

@param string $name
Add a route middleware to the list of executed middlewares .