src/Dispatcher/Dispatcher.php
public function pipe($middleware): self
    {
        if (!$middleware instanceof MiddlewareInterface &&
            !$middleware instanceof RouteInterface
        ) {
            throw new InvalidArgumentException('Middleware must be implement "MiddlewareInterface" or "RouteInterface"');
        }

        $this->middlewares->enqueue($middleware);

        return $this;
    }
public function pipe($middleware): self
    {
        if (!$middleware instanceof MiddlewareInterface &&
            !$middleware instanceof RouteInterface
        ) {
            throw new InvalidArgumentException('Middleware must be implement "MiddlewareInterface" or "RouteInterface"');
        }

        $this->middlewares->enqueue($middleware);

        return $this;
    }
@param $middleware

@return Dispatcher