src/PeekAndPoke/Aviator/Middleware/ServerFrameImpl.php
public function next(ServerRequestInterface $request) : ResponseInterface
    {
        if (! isset($this->providerStack[$this->index])) {
            throw new \LogicException('There is no next middleware');
        }

        // get the next one
        $mw = $this->providerStack[$this->index]();

        if (! $mw instanceof ServerMiddleware && ! is_callable($mw)) {
            throw new \LogicException("The middleware at #{$this->index} is not of type ServerMiddleware and is not callable.");
        }

        return $mw->handle($request, $this->nextFrame());
    }
public function next(ServerRequestInterface $request) : ResponseInterface
    {
        if (! isset($this->providerStack[$this->index])) {
            throw new \LogicException('There is no next middleware');
        }

        // get the next one
        $mw = $this->providerStack[$this->index]();

        if (! $mw instanceof ServerMiddleware && ! is_callable($mw)) {
            throw new \LogicException("The middleware at #{$this->index} is not of type ServerMiddleware and is not callable.");
        }

        return $mw->handle($request, $this->nextFrame());
    }
@param ServerRequestInterface $request

@return ResponseInterface